Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "ocaml"
Now now, chill. I'm using it as my main OS for a few years now. I know what I'm talking and this title is a bit click-baity, but this just has to go out there:
1. It's usable as a Windows replacement just fine - FALSE. XFCE4 is years old and buggy as hell especially on multi-monitor set-up, Gnome3 gets stuck more often than my Windows 98 machine used to, KDE is like a rich kid on meth. Plug in Bluetooth headphones? Well no, sorry, you have to research that online, since you'll probably need to install some packages for it to work. Did I say "work"? Well no, because after more research you realize that Debian on Gnome3 on gdm3 launches pulseaudio on its own, so you have 2 instances of pulseaudio, and one of them is stealing your headphones sometimes and you either have no sound or shitty sound. How do I know that you ask? The same way I know everything else - every time you try to do something new on any Linux, it involves a ton of research. Exciting research, don't get me wrong, but at this point it looks more like a toy than a reliable desktop computer operating system.
2. And why am I using pulseaudio? Why not alsa? years ago people were discussing on forums that pulseaudio is old and dead, yet here we are with new LTS release of Ubuntu still shining with Pulseaudio. How about several different service management systems being deprecated by new ones, each having different configurations and calling methods? Apparently systemd is old and lame now. It's a mix of 10 year old software that works badly, with a 5 year old replacement that works worse, somehow trying to live under the same roof. Does it work? Ask my headphones who sound like a fucking dial-up modem.
3. Let's talk about displays, shall we? xorg is old and deprecated, right? We got Wayland that's mostly stable. Don't know what that is? That's just basic knowledge for Linux. And when you try to install network-manager, it also tries to install Mir toolkits. Because why the fuck not install 3 display managers when you want a network manager, of which one is old and dying, one is young and stupid, and another is an infant that died of cancer?
4. Want to integrate with Google Drive? Yeah, there's a tool that mounts the drive as a local directory. Yeah only for Ubuntu. Want it on Debian? You need to compile it. Oh wait, it's on Ocaml, because fuck mainstream languages, we're hipsters. How do you compile Ocaml? Well you need to have Ocaml on your system, dummy. How do you do that? Well you need to compile Ocaml. Ok, how do I do that? Well, git clone, download and install some dependencies, configure, make... oh sorry, you're using libssl1.0.2g when you need libssl1.0.1f, nope, sorry, won't work. Want to install libssl1.0.1f? Why? You already have the "g", stupid! Want to remove libssl1.0.2g? Bye-bye literally everything that you have on your PC. But at least you got the "f". Does it work now? Well no, because you need libssl1.0.2g for another dependency to work.
And all I ever wanted was to get a fucking document from google drive (not nudes, I promise).
5. Want to watch a movie? Let me tear that screen in half and make the bottom half late by a couple of frames, because who needs vertical sync, right? Oh you do? Well install the native drivers maybe. Oh you have? Welcome to eternal Boot to Recovery mode, motherfucka!
Yeah, most of the times things work just fine. But the reason I know what those things are and how they work is not curiosity. The reason that I know the inner workings of Linux much better than the inner workings of Windows, is because in those few years that I've been using it full time, it has caused me 10 times more headache than I have ever experienced with other systems. And it's not the usual annoyances like "OMG it rebooted when I didn't ask it to", but more like "Oh, it won't work and I need 2 days to find out why" kind of stuff, because even if you experience the same thing again, it's always caused by some new shit and the old solution won't work any more.
I still love it, and will continue to use it. I don't know why really. Maybe because I'm not afraid of fucking it up any more? Maybe because I can do what I want in it and recovering will be easier than on Windows?
It's a toy for me, after all these years. And I also use it for professional reasons.
But whenever someone presents it as a better alternative to Windows, I just want to puke.52
Visited Java and couldn't C on short distances. Went to an iClinic that Swift'ly gave me c++ goggles. I can now C# but I Haskell been struggling with my OCaml as it's been bit by a Bash'ing Python in a Shell. I'm not trying to sell you a Ruby but I can't find my way back to BASIC.4
1 like and i apply to f# jobs with only ocaml experience and when they ask about it ill just say "well f# is just a cheap ripoff of ocaml so i should be fine"12
Okay this is it; FUCK java on android. You need so many fucking workarounds, its insane. Im tryna merge to bmps together, one on top, and the helper class is at 400 lines already and its only kinda working. If you gonna abstract things away, then fucking abstract them well (ocaml) or not at all (c).16
When i started ocaml. Now most languages use
But not ocaml. No, it uses
So i had the genius idea of writing my own lib and submitting my program as
let () =
Ocaml, the strictest language when it comes to types i have ever seen, parses a string to a general json object in around 5 loc.
Take notes java.12
They've just brought in a desk to my office. They're gonna bring another Dev in...
This guy apparently works Erlang, Ocaml, Python... I work all C# so this is bound to be fucking good! Hahaha I'm happy.4
I prefer functional style programming because it is easier to me to think in modules and functional hierarchies than it is object style shierarchies.
All in all, languages like F# and Clojure have always been fascinating to me. I wish I could find a use case for Haskell, but I can't. If anything F# is awesome to me because I already know .NET and really dig the entire framework, the strides made by Core are outstanding.
I had tried Scala before and just couldn't get into it. Far easier to just stick to Java even if I hate the idea of extending classes all over the place.
Ocaml is interesting too, but I know little to nothing about it, and Elixir looks far too much like Ruby for my taste even if I do like Ruby.
Choice is good, but sometimes overwhelming14
- Leave current shitho...job and join something exciting
- Draw at least 1 manga chapter, im fine if its a one shot or something, i just wanna do it
- Master ocaml
- Move to a big city
Will happen, just not necessarily in 100wks:
- Arduino up my car
- Start a company
- Have at least one open source project that is somewhat successful. Id be more than happy with like 20 stars on github. Currently working on a REST backend generator, that might be big.
- Get a cat.
I hope will happen at least sometime:
- Move to USA
- Finish a Volkswagen collection
- Have a career as an anonymous dubstep artist2
I just learned about the glorious language called batsh. It compiles, to bat and bash.
Considering learning OCaml to contribute, this is the holy grail that will bind us all together.5
After struggling with js for a while, bless the ocaml ecosystem and community, now i actually get shit done instead of fighting with npm.21
Why is it that virtually all new languages in the last 25 years or so have a C-like syntax?
- Java wanted to sort-of knock off C++.
- C# wanted to be Java but on Microsoft's proprietary stack instead of SUN's (now Oracle's).
- Several other languages such as Vala, Scala, Swift, etc. do only careful evolution, seemingly so as to not alienate the devs used to previous C-like languages.
Now we're slowly arriving at the meat of this rant: back when I started university, the first semester programming lecture used Scheme, and provided a fine introduction to (functional) programming. Scheme, like other variants of Lisp, is a fine language, very flexible, code is data, data is code, but you get somewhat lost in a sea of parentheses, probably worse than the C-like languages' salad of curly braces. But it was a refreshing change from the likes of C, C++, and Java in terms of approach.
But the real enlightenment came when I read through Okasaki's paper on purely functional data structures. The author uses Standard ML in the paper, and after the initial shock (because it's different than most everything else I had seen), and getting used to the notation, I loved the crisp clarity it brings with almost no ceremony at all!
After looking around a bit, I found that nobody seems to use SML anymore, but there are viable alternatives, depending on your taste:
- Pragmatic programmers can use OCaml, which has immutability by default, and tries to guide the programmer to a functional programming mindset, but can accommodate imperative constructs easily when necessary.
- F# was born as OCaml on .NET but has now evolved into its own great thing with many upsides and very few downsides; I recommend every C# developer should give it a try.
- Somewhat more extreme is Haskell, with its ideology of pure functions and lazy evaluation that makes introducing side effects, I/O, and other imperative constructs rather a pain in the arse, and not quite my piece of cake, but learning it can still help you be a better programmer in whatever language you use on a day-to-day basis.
Obviously these curly-braces languages will still be needed for a long time coming, legacy systems and all—just look at COBOL—, but my point stands.7
Just did a performance benchmark of my project written in OCaml and I have to say, I'm really surprised by how fast OCaml is.
There are several other implementations of the same algorithm in other languages and the OCaml code beats almost all of them.5
Hey, dfox & trogus
How about some Haskell/Scala/F#/OCaml/Clojure/Scheme swag? For example, I'd love a Haskell-caped devDuck.
Show us functional programmers some love pls ;_;2
You knoe, my first insights into computer programming came out of spite. I thought windows to be garbage and wanted to blame someone other than myself for my machine constantly crashing. Thus I discovered programming and down the rabbit hole. But my interest in computer science came from videogames. Portal in particular. I found the idea of GlaDOS fascinating and thought that artificial intelligence would be something interesting to research. The web then gave me Lisp, and boy was the language different from all the other languages I went through. I remember feeling super excited when Racket, Common Lisp and eventually Clojure would help me discover many different ideas. Every time I work with reduce or maps or stuff like that in other languages I always thank languages such as Clojure for having me descipher different ways of manipulating data to get a result. To this day I feel sad whenever I find that my languages do not have the same constructs that Clojure has. I mention Clojure because it is my favorite flavor of Lisp. But one thing that always remains grest to me is firing up Emacs and plugin my code to Slime or Cider and see the repl pop up waiting for something to happen. This feeling is beautiful.
Please guys, if you have not tried it, do so! You might hate it at first or push it aside. But trust me, once you get it it will really change the way you think about programming in general. Try the great Clojure for the Brave and true, and go through the third chapter succesfully. If you do not like Lisp by them then no harm done! You would at least know that there are other options.
Now, here are some cool things:
For the standard implementation, try Common Lisp
For a more modern Scheme, try Racket or Guile
For targetting the JVM try Clojure (more akin to Common Lisp) or Kawa (scheme like)
For the python AST get Hy (pun totally intended)
For JS try Clojurescript
For emacs scripting try Emacs Lisp (has way too many disasdvantages but still relatively close to common lisp)
Honorific mention to more pure functional programming languages for Haskell, F#, Ocaml.
Also worth mentioning that Js , Ruby and Python have great functional constructs.
(println "you will not regret it!")2
Spent at least an hour trying to debug this ocaml function, only to realize "end" was a reserved word that my text editor didn't highlight. Classic.3
Even if he's a younger guy than most other examples, my mention is:
He's the inventor of React, which probably changed the way to write (web-)apps for a lot of people and was based on a prototype written in StandardML.
He's also created ReasonML which is not only in many ways a more fitting language to write React, but also a good systems language (props to OCaml and it's unbreakable type system). Many React concepts/patterns have their origins in functional language concepts, including reducers and hooks.3
Currently VSCode just because I am not that into Vim and it supports most languages I have to deal with very well (ReasonML/OCaml, TS, JS).
But when OniVim2 will be completed, that will probably it. I pre-purchased it and the instant startup time while still supporting vscode extensions are already promising.
Rust and Go birth is a result of new-age propaganda. May the almighty OCaml bless both of you to have ruined future!
Long live OCaml!7