8 ms·
For almost as long as I've been programming, I find Ocaml a fantastic language, which just lacked some development tools and improved concurrency. I still belie
by sunflowerdeath 4y ago
For almost as long as I've been programming, I find Ocaml a fantastic language, which just lacked some development tools and improved concurrency. I still believe that under the right circumstances it could become a mainstream language.
- StevePerkins 4y agoIf this were really true though, then wouldn't F# be bigger than it is?
- ipiz0618 4y agoF# is a fantastic language! However, its official documentation is a bit lacking (like the C# ones). Also having developed some reactive applications I'd say .NET core needs some improvements before people can have fun developing desktop or web apps with it
- mm007emko 4y agoExactly. Functional programming has been around for quite a while, it just recently became the FAD of the day, just search youtube for "functional programming in javascript". This will fade away in just a couple of years. F# is an interesting language and yes, I used it at work a couple of times. However finding a programmer who is into that is hard and the HR "partners" will kill you because people like these can't be treated as cheap replaceable resources. So it was F# prototype -> C# production. Attempts to introduce a new language or a tech stack usually failed because the decision makers (managers) were concerned about "how many people can I hire within a month" than anything else - nobody was fired for picking Java, C# or JavaScript (TypeScript) for the next project and staffing accordingly. Languages like OCaml, Haskell, Lisp (whatever flavour you pick) or Prolog will never become mainstream. Should they even? My favourite is one of them for my general hacking or research projects; not sure I'd like to use it in a corporate job (which I have right now). Small efficient team in a tech start-up? Hell yeah! Mainstream mundane programming? OMG NO! Horses for courses. Hearses are not mainstream vehicles yet all of us will need a ride in one occasionally. Does it mean they should become popular and mainstream? :-D
- nouveaux 4y agoFunctional programming is not just the FAD of the day. This is evident by the strong presence of functional programming in Rust, an imperative language. Functional programming is also the foundational idea behind React. As with most things in life, extreme ends of the spectrum rarely pan out. Pure functional programming languages are harder to work with but functional programming has a ton of merit. It's here to stay. Regarding Ocaml, the functional aspect of the language is not hard. I have trained several junior programmers to write code in it (ReasonML). It is not a pure functional language. The biggest challenge for most people is dealing with types. Ocaml's standard library is a huge sore point. It also lacks a lot of proper tooling. The biggest problem with Ocaml/ReasonML is that they are unable to rally everyone to a unifying vision to gain traction.
- Kototama 4y agoThe alternative Base/Core from Jane Streets looks good though. Of course it splits the community but the work done on it is very good.
- occamrazor 4y agoThey’re great, but Base is new(ish) and not complete and Core is Linux only (maybe it work on OS X too?)
- rbjorklin 4y agoThe Unix bits were broken out of core earlier this year, it’s now multi-platform. https://discuss.ocaml.org/t/ann-v0-15-release-of-jane-street-packages/9612 https://discuss.ocaml.org/t/ann-v0-15-release-of-jane-street...
- occamrazor 4y agoThat’s great to hear, I missed that update (still on 0.14).
- deleted 4y ago
- resoluteteeth 4y agoF# is great and it benefits from the .net ecosystem but at the same time the language sometimes feels like it is being held back now by not wanting to add new features that c# doesn't support, so its relation to .net is kind of both a blessing and a curse. Previously it added a lot of stuff on its own like async, etc. which was cool but also resulted in compatibility issues when c# later added similar features. Now the f# developers are very concerned with compatibility but it basically means that f# can't get new features until c# already has them. It's also limited by the runtime which is designed around c#. For example, it doesn't support type classes because (among other reasons) that might end up being incompatible with future c# type-class like features several years down the line. It's also hard to learn f# unless you already know some ocaml/haskell. ocaml has failed to catch on that much so far but I think it does have potential, and adding multicore support/effects is pretty promising. On the other hand the fragmentation with stuff like reason/rescript is pretty dumb.
- giraffe_lady 4y agoFrom a pure pro-ocaml perspective I don't really appreciate rescript per se. But it truly does seemed to have raised awareness of the language among web devs who otherwise don't have a reason to worry about much outside of js/ts. The timing is also good because typescript has directly shown devs the value of types, and taught them enough about them to understand what ocaml is really offering above ts-style static type checking. That's my impression from my last two typescript jobs, anyway. I don't know what, if anything, will come out of this, but I can't see it being bad.
- cassepipe 4y agoI am curious. What does Rescript have that Reason did not have ? I know the syntax is now incompatible syntax with OCaml so I see the broken eggs but I don't see the omelet.
- resoluteteeth 4y agoI don't think it's that different at the moment but they apparently wanted to not be constrained by reason/ocaml compatibility going forward. Reason seems to be pretty dead so now the relationship between ocaml and rescript is kind of like that between haskell and purescript. This may be good if you only want to run it on the frontend but it's not as good if you're using ocaml on the backend and want to share code, but I guess there's js_of_ocaml I also don't think the existence of rescript is in itself a bad thing, it's just that the whole confusion around reason/rescript may have harmed development of ocaml for a while.
- deleted 4y ago[deleted]
- pjmlp 4y agoF# suffers from being a stepchild in what concerns .NET product management. They accepted to place it on the box, but never gave it the same love as VB and C#, or even C++/CLI, and now they could rename the Common Language Runtime into C# Language Runtime, given how little outside they give to anything not C# on newer workloads. Had F# been given feature parity with C# and VB on Visual Studio tooling and core frameworks, the adoption scenario would be much different.
- lostdog 4y agoF# can't become big for the same reason C# isn't bigger and Swift probably won't be bigger either. It's locked into an OS-specific platform and very specific non-free dev tools. (Even if .net is open now, it still took too long to be available on Linux, and now it's reputation is as a Windows only platform).
- nojito 4y agoF# isn't bigger because it's a functional language and everyone starts learning programming with a C based language.
- filoleg 4y ago> everyone starts learning programming with a C-based language Idk about that, especially in the past decade. Python seems to be the most popular language that people pick up on their own as their first one. As for the intro college courses for programming, they mostly seem to be Python or Java, with occasional C (havent seen that one myself yet for an intro class), and one incidence of OCaml (apparently Cornell teach their intro to CS in it).
- nojito 4y agoPython is in the C family of languages https://en.wikipedia.org/wiki/Generational_list_of_programming_languages https://en.wikipedia.org/wiki/Generational_list_of_programmi...
- woevdbz 4y agoI like the language, but I'm not sure that it actually targets any mainstream application. If you look at something like golang, it's very geared towards online server work bc that's what the language maintainers wrote it for, hence a lot of focus on GC-induced tail latency. Python and its package distribution system are great for glue code that's going to pick from a wide library of modules. C++ is amazing for portability and performance / zero cost abstractions. Java has its weird cult in enterpriseware and also is an OK glue layer for mobile UI stuff. Comparatively, OCaml was initially written with symbolic operations in mind, and thus I personally think it's a great language for writing parsers, compilers, modeling systems etc. The type system makes it easy to avoid certain kinds of common errors in those programs and the tail latency of GC operations is typically not as important for those applications as overall throughput. I don't think that heavy symbolic computations are a mainstream target though. To be clear I think that's absolutely OK for a language not to aim for mainstream use; but if one wishes for mainstream use, then it's important to be clear about the kinds of use-cases within mainstream that will be targeted. It has been a while since I played with the language though, so maybe things have changed since. Happy to learn more if I'm wrong and OCaml now has a clear mainstream target use case in mind.
- yawaramin 4y agoWhy does OCaml need a 'clear mainstream target use case in mind'? It's a general-purpose language. It can be used for anything that Java, Go, or Python can be used for, and many things that C++ can be used for to boot. Sure, OCaml's heritage is descended from a theorem prover helper language, but that doesn't meant it's forever stuck at that use case. Python was originally an educational teaching language, nowadays it's a data science and glue language. None of that was planned out in advance by the Python folks. In fact even if you ask the Go team, Go is arguably the most targeted language of the ones you listed, in terms of its use case--and they were surprised that a lot of their userbase came from ex-Python devs who wanted something more reliable and efficient! OCaml with version 5 is just hitting its stride. With the advances in the language, the multicore support, and tooling, it's going to be competitive with Rust for many use cases. It's worth the wait to see where it goes.
- 4y ago
- epolanski 4y agoIf I have learned something is that software, not the language, sells the language. Mainstream languages have killer software (Spring, Synfony, Pandas, whatever) which then prompts adoption. Languages for mainstream programming are less of an issue than the software. Haskell, CommonLisp, etc, plenty of great languages lack that killer software or clear benefits over other mainstream languages.
- sidkshatriya 4y agoWhat you said is correct. But then for someone to build the "killer software", they need to be attracted to the language in the first place. The language needs to excite the programmer behind a (future) breakout project. Sometimes the language is chosen by luck (e.g. company requires it) but many times a programmer will make an explicit choice to use that language.
- dkarl 4y agoI remember Python being already popular in 2000 as a scripting and glue language, a Perl replacement for people who recoiled from Perl, or whose coworkers rejected Perl. Then Eric Raymond wrote a glowing article about his first experience with Python[0], which brought it even more attention. Pandas didn't exist until much later. Same thing for Spring. Spring came about as an attempt to make J2EE more usable, which is to say, it didn't exist until years after Java was already being widely adopted in the industry. Checking on Symfony since I'd never heard of it, it was first released in 2005, which was after PHP had already become popular enough to become the archetypal "bad language" in the minds of people who had never used it. I think what you're seeing is that the ecosystem that develops around languages reflects their popularity and the interests of their users. As a readable, low-complexity glue language, Python became popular with scientists and then (unsurprisingly in retrospect) people started using it for data analysis. Java became popular with big iron enterprise programmers, and so it sprouted enterprise frameworks where half your code was in XML. PHP was popular for small web sites, so it spawned a whole menagerie of web programming frameworks. A language without any ecosystem growing around it is probably a language that doesn't get used much. For a more contemporary example of language adoption, look at Rust. The appetite for the language existed from the get-go based on its design and stated goals. There was a lot of excitement, even from people who said they couldn't adopt it yet because of the lack of ecosystem around it. As the ecosystem developed, more and more people adopted it the moment it was practical, establishing it as a mainstream, growing language prior to the existence of any killer software. In the future maybe there will be a killer Rust framework that brings in a lot of people with no interest in Rust the language, but Rust is thriving despite that killer app not existing yet. [0] https://www.linuxjournal.com/article/3882 https://www.linuxjournal.com/article/3882
- butterisgood 4y agoWas used to bootstrap Rust. Others clearly also think it's a great language!
- dmitriid 4y agoI think it could've been huge with Reason, but they decided to split the language, the development, and the community apart.