News for hackers. Stuff that matters.
Re:What the interns have wrought, 2020 edition by johnisgood on Tuesday August 25, 2020 @11:31AM (#24272377)
Yep, and they use OCaml! I always feel like I have to point it out since people do not think much of it, have lots of misconceptions of it, and so on.
Re:What the interns have wrought, 2020 edition by geodel on Tuesday August 25, 2020 @11:54AM (#24272613)
It need to be pointed out because there may be like grand total of dozen companies which uses OCaml so it is something remarkable.

It is like paintings from famous painters in billionaire's homes. Now for me and may be for lot of people stuff from Bed Bath and Beyond is just fine on our walls. So for ultra-rich / successful/profitable company might see beauty in Ocaml but most of the world runs fine on run of the mill services in PHP/Java/.net etc.

Re:What the interns have wrought, 2020 edition by Barrin92 on Tuesday August 25, 2020 @12:28PM (#24273059)
>but most of the world runs fine

most of the world doesn't run fine. If airplanes were built like your average software stack they'd drop out of the sky every other day.

Development practise at a place like JaneStreet is an example how things ought to be done. I really dislike the analogy of Ocaml as some sort of esoteric billionaire tool. It's just a sound language that everyone can understand, it's not even particularly academic despite its reputation. This is just what software engineering looks like if you actually treat it like... well engineering.

Re:What the interns have wrought, 2020 edition by geodel on Tuesday August 25, 2020 @01:12PM (#24273551)
> If airplanes where built like your average software stack they'd drop out of the sky every other day.

I missed to add C/C++ to my list. That would have covered real time systems you mention.

> Development practise at a place like JaneStreet is an example how things ought to be done.

As much I agree Jane street is doing cutting engineering for their domain, it seems unrealistic that rest of the world is unaware of good software engineering in generic usecases.

Re:What the interns have wrought, 2020 edition by noir_lord on Tuesday August 25, 2020 @04:14PM (#24275591)
> it seems unrealistic that rest of the world is unaware of good software engineering in generic use cases.

Depends on who is aware and whether they have the clout to actually implement it, the trenches are full of developers who know there are better ways and that those better ways would have a positive RoI but that it wouldn't show up possibly for 3-4 quarters minimum which makes it a hard sell to management if you can get them to even understand it without a tortured analogy - those programmers frequently don't have the authority to enforce the standards particularly when the other half in the trench with them are busy adding to the pile or actively fighting against it.

There have been times where I've wanted to shiv (figuratively) a developer who writes the worst most pointless convoluted code after he proclaimed code should be "self documenting".

Fortunately these days I'm at a level where at least for my teams I can enforce whatever standard we agree on and if we can't agree then the one I agree on - if we can't reach a consensus I operate on democratic principles, one man, one vote - I'm the man, I have the vote (though I try to avoid having to do that).

Re:What the interns have wrought, 2020 edition by kyawzazaw on Tuesday August 25, 2020 @01:05PM (#24273478)
What development practices do they have that is unique to them?
Re:What the interns have wrought, 2020 edition by avasthe on Wednesday August 26, 2020 @06:18AM (#24281046)
Most of the world doesn't run fine. The manager who was previously an accountant can't see the benefits of reliability, security or performance, and hires some straight-out-of-the-bootcamp people.
Re:What the interns have wrought, 2020 edition by jkaptur on Tuesday August 25, 2020 @12:11PM (#24272831)
I guess I might have some misconceptions of OCaml. Are there other companies that use it? I ask because whenever someone says "OCaml is used in industry, for example, Jane Street", they say it like it's just one example, but it's always Jane Street.
Re:What the interns have wrought, 2020 edition by kdkeyser on Tuesday August 25, 2020 @03:53PM (#24275334)
I worked at a startup (Amplidata) where we build a distributed storage system in OCaml. It got acquired by Western Digital, which later sold it to Quantum. Afaik, there is still development going on using OCaml.

Couple of things I took away from the experience:

- After an initial ramp-up, most of the developers liked or even loved the language. Downside was the limited tooling/libraries (2010-2015, seems better now).

- Quality of the resulting product was quite high: bug rate was fairly low, especially once experience with the language increased. Turns out sum types, gadts and the module system (functors) are very powerful to express invariants and design composable logic.

- OCaml was successfully picked up by team members without a formal computer science background, or even without a lot of programming experience. Not that it turns everybody into a great programmer, but it seemed to coerce new hires into delivering a working feature, without a huge risk of breaking a lot of other code.

- It is still possible to write crappy / unmaintainable code. But in OCaml it is often as easy (or even easier) to write good code.

- If something did turn out to be broken, it was painful. Debugger support (GDB) was initially non-existent. Under heavy load, we triggered a couple of bugs in libraries, which was quite painful to fix. On the other hand, we also triggered bugs in malloc and in the Linux kernel, which were as painful, so it might have had more to do with the high-load scenario, than with OCaml.

- For really low level stuff, or very high-performance cases, we did need to use the escape hatch to call C code. Interfacing Ocaml with C was not the most pleasant (was before ctypes library). Debugging bugs at that boundary was extremely unpleasant. One trigger for this was the fact that multicore OCaml never materialized, which also damaged the "political position" of OCaml within the company.

- Management (especially after the acquisition) was at best indifferent, and at worst hostile towards it. OCaml was perceived as being difficult to hire for (or outsource). Using more "standard" languages like Java, C++, Python was seen as the safer bet. They tried and often failed (C++ turns out to be damn complex, and maintaining a large Python codebase turned into whack-a-mole, but for bugs.).

Re:What the interns have wrought, 2020 edition by angio on Tuesday August 25, 2020 @12:15PM (#24272901)
The OCaml website lists some companies it [0], I think there are a bunch of new blockchain startups that are also using OCaml but are not on that page.

[0] https://ocaml.org/learn/companies.html

Re:What the interns have wrought, 2020 edition by non-entity on Tuesday August 25, 2020 @12:20PM (#24272970)
Is there something about purely functional languages that make them attractive to blockchain applications? I remember a post on here a little while ago complaining about Haskell adoption in industry was being mostly led by cryptocurrencies.
Re:What the interns have wrought, 2020 edition by twic on Tuesday August 25, 2020 @12:34PM (#24273120)
One person might say that the common factor is not being frightened of doing something challenging and unconventional that allows you to achieve extraordinary things.

Another might say it was a weakness for snake oil.

Re:What the interns have wrought, 2020 edition by uHuge on Wednesday August 26, 2020 @11:48AM (#24283533)
You have high-stake operations in relatively small code base, so you better pick a language and tools compatible with formal verification or even supporting it natively.
Re:What the interns have wrought, 2020 edition by nesarkvechnep on Tuesday August 25, 2020 @01:29PM (#24273753)
Just to make it clear, OCaml is not purely functional.
Re:What the interns have wrought, 2020 edition by non-entity on Tuesday August 25, 2020 @01:32PM (#24273781)
Oh sorry, not sure why I thought it was.
Re:What the interns have wrought, 2020 edition by johnisgood on Tuesday August 25, 2020 @11:23PM (#24278778)
Yeah, it most likely is not. I mix imperative, OOP, and functional all the time. Parts of my codebase that has to do with algorithms are written using imperative style, the "public API" is OOP (class, object, methods) which makes the use of my library a breeze, and the rest is functional.

To give you an example of how you would use some crypto-related library that implemented its API (?) in OOP:

  let x = new Foo.bar in
  x#absorb a;
  x#squeeze b;
  x#reset
Or take a look at: https://github.com/xavierleroy/cryptokit/blob/master/src/cry...

This (this entire file) is a great example, too!

Re:What the interns have wrought, 2020 edition by dimitrios1 on Tuesday August 25, 2020 @12:57PM (#24273399)
Facebook is big into it via tooling and compilers. It's also big on the Messanger team ala Reason.

Ahrefs is another one I know of.

And hopefully (maybe?) my company soon.

Re:What the interns have wrought, 2020 edition by johnisgood on Tuesday August 25, 2020 @07:34PM (#24277504)
Frama-C, Why3, and Coq are written in OCaml. :)
Re:What the interns have wrought, 2020 edition by sweeneyrod on Tuesday August 25, 2020 @07:55PM (#24277639)
I think some popular misconceptions about OCaml are actually driven by its connection with Jane Street. Because they are the most prominent industrial user, people can think it is good for their niche but not useful outside it, or that it's very academic/difficult to learn/ideologically purist. But actually it's a fine general purpose programming language.
Re:What the interns have wrought, 2020 edition by johnisgood on Wednesday August 26, 2020 @01:18AM (#24279372)
I am not sure why one would assume it is niche (someone said OCaml is "super-niche") just because Jane Street is a prominent user of it. In any case, yeah, it is an excellent general purpose programming language. I replaced a scripting language with it. I now use Go and OCaml instead of say, Lua, because I had to reimplement the wheel when I used Lua. Perl and other scripting languages were too slow for my typical use-cases.