Eliom always seemed too complicated to me. It appears to do great things, and seems well engineered; but it felt too hard to use, and the documentation was organized in a challenging way for a newcomer. At least that was my impression a couple years ago, maybe I should give it another try.
I had high hopes for Opa once, as well... they just went in opinionated directions (NPM, MongoDB) that didn't resonate with me.
The following Google Quickview link might work.
Take a look at the "success" link that /u/Drupyog shared; there are plenty of GUIs there.
Also, 0install recently ported from Python to Ocaml, and it has a cross-platform GUI. I really recommend reading Thomas Leonard's blog posts on how he selected Ocaml for the 0install rewrite, and wrote the new implementation.
> Considering how young Clojure is as a language it's amazing how widely used it is today.
Yes but the same is true of F#. Traders buying or selling coal, oil, gas or carbon credits in Europe are almost certainly running F# code on their desktop. Customers getting insurance quotes from one of the world's largest insurance companies are having it calculated by F# code. The world's largest marine broadband provider uses OCaml. MATLAB and Mathematica are both partly written in OCaml. The Louvre Abu Dhabi is being architected using F#.
Clojure and F# have been leapfrogging each other over the past few years in terms of popularity in the job market.
Then consider how language ideas are seeping into mainstream languages. Java and C# got garbage collection and lambdas from Lisp, granted, but they didn't take homoiconic syntax or macros. Then they took generics (which is parametric polymorphism from ML) and C# took type inference and async from F# (which took it from OCaml).
So the race is not yet run. Both Clojure and F# are seeing far more use today than any FPL before them. I'm just saying ML is definitely going to beat Lisp, that's all. :-)
This is a very concerning attack on core open source infrastructure.
I see parallels to the hack of matrix.org, which serves the Riot messenger client - the perhaps most usable multi-platform, strongly encrypted, open source and usable by normal people text messaging client:
It would help if you told us how much experience you have with programming tools in other languages. What have you used so far? What IDEs, if any, have you used?
You should probably learn to use competently at least one decent general-purpose editor (by which I do not mean Notepad). Since you live in the Windows world, something like Atom might suit you. It has OCaml support (you need to install the relevant packages).
It's still too difficult to get OCaml going on Windows.
See this recent discussion on the caml list for answers.
TL;DR: There are a bunch of methods for exchanging small amounts of data between processes (Parmap and Async Parallel). They don't necessarily all work on Windows. For exchanging a lot of data, netmulticore is the only viable solution, and it's not particularly safe.
If the exercise is bob, you need to distinguish whitespace from non-whitespace, and detect !
and ?
. You could either write a for-loop iterating on each character in turn (on which you can use pattern-matching), or using a fold
function to use a more functional style to do the same thing. With a loop, the state you accumulate will be placed in mutable references, with a fold it will be explicitly passed around.
There is no convenient syntax for regexp operations (matching and substitution) in OCaml. Libraries do support regexp matching and substitution (see humane-re for example), but this exercise does not require any regexp usage.
You should avoid using (^)
for string concatenation: its cost (in time and space) is the sum of the lengths of its two parameters, so repeated concatenation in a loop may result in quadratic behavior. This is a mistake that beginners often do. If you find yourself needing to concatenate lots of small string fragments, put them into a list and then String.concat
, or use a Buffer
module.
In the frontend world, React kinda has algabreic effects in its hooks API. Something I've been interested in is applying ocaml algabreic effects to React (via ReScript) so as to avoid the many footguns, pitfalls, and most importantly to maybe be able to get rid of or loosen some of the rules of hooks and strange APIs these produce like useEffect's dependency array.
I know that this use case would be a side effect (pun intended) of the multicore ocaml project, but I was wondering if it's something that's ever been discussed between yourself, your peers, or maybe the React team?
I’d also suggest checking out this VSCode plugin instead: https://marketplace.visualstudio.com/items?itemName=jaredly.reason-vscode
It seems to have become the main ocaml/reason plugin.
There’s a version of it for Atom as well: https://atom.io/packages/ide-reason
Best option would be WSL like /u/gxrmr suggests. Another idea would be to use repl.it, which recently added experimental OCaml support (here), which should be good enough for basic OCaml, but is likely to fall flat for things like trying to use Base or Batteries. You could also rent a Linux VPS and set up a workflow around editing code locally but using the VPS for OCaml. Emacs, for example, can edit remote files via SSH with TRAMP, so you can have your OCaml compiler and source files on the VPS, but edit them in a way that feels local.
Still, try WSL first if you can, it's the best option: should run better than a VM, with no additional costs. Still uses similar disk space as a VM, though.
> https://sketch.sh/new/ml is good for playing around with / sharing OCaml snippets online without having to install anything on your computer.
A week late but I wanted to thank you for mentioning sketch.sh. Normally I use repl.it for that sort of thing, but it doesn't have OCaml yet, which I found disappointing. It's not quite the same, but close enough for what I normally want it for, which is snippet sharing or using my android tablet to goof off with a language while I'm not at my PC.
For the latter I've been having to ssh into my desktop and run utop, which works but isn't the best way to go about it. (I did also try compiling ocaml from termux but had no luck with that.)
perhaps not advanced enough, and not ocaml enough, but [the functional approach to programming[(https://www.amazon.com/Functional-Approach-Programming-Guy-Cousineau/dp/0521576814) is one of my favourite programming books ever.
> it looks like we might switch to having a single shared major heap anyway.
I'm not sure what to think of this. Having a truly concurrent shared-heap GC is a much harder problem than having a completely independent GC per thread. Sometimes the only winning move is not to play.
It occurred to me that I could try to help you set it up directly if you get desperate. Since you have a Pi you could set up a temporary account and DM me the connection info, and I could attempt to set up a bare-bones emacs+merlin configuration on the account that you could use as reference or a baseline. Or if you have a cheap VPS I could do it on that, same result.
I understand if you don't want that since I'm just some random person on the internet but I figured I'd offer anyway. I've been helping friends with Linux server stuff like that for ages so I'm comfortable doing stuff like that and since emacs works on the terminal as well it'd be easy enough. Would just need ssh access and maybe mosh + tmux if the connection latency is high.
I think you can figure it out yourself eventually (maybe try a second account with a fresh configuration of everything and experiment), but figured I'd offer.
This is the best answer currently afaik. In lambda-term, (2) is used extensively, along with (1) and state encapsulation.
>What data is required vs. optional on an Invoice in our business domain? Can this value be a negative number? Let's write this all down as a type definition." Rather, you just open a REPL, shove some data into a dictionary and start poking at it.
Actually, most Clojure developers will validate data on projects "boundaries" using libraries like Clojure spec.
Scala default immutable Maps and Sets are backed by HAMTs I believe. Its vectors are a bit different though? http://www.scala-lang.org/api/current/#scala.collection.immutable.Vector
Could you point me to the lib you're referring to?
> I think it's a bit of a shame as F# is a very nice language, but it is clear that it hasn't managed to get a lot of traction so far.
I already pointed you at ~50 counter examples here.
you might find haxe interesting - it's not in the ML family, but it has clear ML influences, and a C like syntax. also it compiles to a bunch of different targets, including desktop, web and mobile.
Sweet! It's been on my queue to implement one for the purpose of implementing https://matrix.org/docs/api/client-server/ , but haven't of course completed it. Maybe now I get to do the actual library involved ;).
My only worries are that now
But I'll see about the second part!
Preprocessors are generally ugly part of the language, besides RWO there are two other really good books about Caml (functional programming) in general:
http://caml.inria.fr/pub/docs/oreilly-book/
https://www.amazon.com/Functional-Approach-Programming-Guy-Cousineau/dp/0521576814
These two books not only teach you how to use OCaml but also think in a functional way