5 ms·
What's the current state of OCaml on Windows? I'd love to use OCaml on more of my projects, but this has been a roadblock for me. What I'm looking for is the
by kxyvr 8y ago
What's the current state of OCaml on Windows? I'd love to use OCaml on more of my projects, but this has been a roadblock for me.
What I'm looking for is the ability to produce native binaries without Cygwin. I just checked without installing anything and it appeared as though OCPWin was still the choice, but it's been stuck on OCaml version 4.01.0, which was released five years ago. I know that OPAM is pushing toward a 2.0 release very soon and I didn't know if that was going to coincide with a stable OCaml/OPAM release on Windows, which would fix my problems. Does anyone have an idea?
- nikofeyn 8y agowhy don't you just use f#?
- krylon 8y agoNow that you mention it, can somebody recommend some good starting points for learning F#? That language has been on my bucket list for far too long.
- phillipcarter 8y agoHere's a good place to start: https://docs.microsoft.com/en-us/dotnet/fsharp/ https://docs.microsoft.com/en-us/dotnet/fsharp/ In addition to linking to other parts of the documentation, it links out to other third-party learning sources.
- markdoubleyou 8y agoThe "F# for fun and profit" site by Scott Wlaschin is a great jumping-off point: https://fsharpforfunandprofit.com/ https://fsharpforfunandprofit.com/ I discovered it when I was reading a lot about domain driven design, and I stumbled upon a talk by the author that kind of blew my mind: "Domain Modeling Made Functional" https://www.youtube.com/watch?v=Up7LcbGZFuo https://www.youtube.com/watch?v=Up7LcbGZFuo
- fsloth 8y ago"Expert F#" by Don Syme et. all. is a great starting point. It explains how to get started and contains lots of non-trivial code to type in and try out yourself. Don Syme designed F# as a no-nonsense industrial language and this book is a great introduction from that point of view. Then there is "Programming language Concepts" by Sestoft - which, while being a language book, at the same time exposes lot of beautiful patterns how to exactly use F# for data munching. Then, thirdly, Jon Harrop's "F# for scientist" is a great introduction for us that have a penchant foe writing numerical code (graphics or whatever). It's a great companion for the Expert F# as it shows how to use F# effectively in place of sonething like C++ or fortran.
- deleted 8y ago[deleted]
- kxyvr 8y agoI've thought about it and wrote a bunch of trial software to test things. Primarily, I work on Linux even though I support Windows. There are also some features in OCaml that I like, which are not available on F# such as the module system, polymorphic variants, and, in the past, camlp4. While these can be worked around, the other use case is running the software on an HPC system using MPI. For me, the use of OCaml or F# is a glue, so I'm not worried about the performance. I am a little worried that the HPC administrators are going to have some difficulty getting the correct setup for F# across all the nodes. For OCaml I don't view this as much of a problem since it just produces binaries. Now, I absolutely could be wrong about this and I'd appreciate if someone where to chime in if so.
- smortaz 8y agoIf you want to try F# w/o any installation, try it in Jupyter on Azure Notebooks: https://notebooks.azure.com/Microsoft/libraries/samples/html/FSharp%20for%20Azure%20Notebooks.ipynb https://notebooks.azure.com/Microsoft/libraries/samples/html... Browse w/o loggin in, or if you want to edit/run/..., sign in, click Clone, then play around. Cheers.
- jug 8y agoBTW, just a reminder of F# on .NET Core for fun (and profit?), and cross-platform support. It’s not Microsoft’s primary language and unfortunately sometimes shows but now it’s there. https://docs.microsoft.com/en-us/dotnet/fsharp/get-started/get-started-vscode https://docs.microsoft.com/en-us/dotnet/fsharp/get-started/g...
- djs55 8y agoAre you trying to avoid linking against Cygwin at runtime or trying to avoid Cygwin in the build environment too? In my case I use Cygwin in the build environment (see https://github.com/moby/vpnkit/blob/master/appveyor.yml https://github.com/moby/vpnkit/blob/master/appveyor.yml) using Andreas Hauptmann's https://github.com/fdopen/opam-repository-mingw https://github.com/fdopen/opam-repository-mingw but I end up with an executable which doesn't require the Cygwin dll at runtime. I'm looking forward to the day when I won't need Cygwin even in the build environment. Since the OCaml compiler itself works fine on Windows and modern build systems like "dune" are also Windows-friendly I'm fairly optimistic this can happen soon. I think it'll mostly be a matter of removing accidental Unix-isms (like unnecessary use of symlinks) in the build scripts.
- kxyvr 8y agoMostly, I'd like to ensure that I don't like the dll, so that I don't have to attempt to distribute it. More selfishly, I'd like to have a straightforward installation process where I pull down only a binary or two and can have a working environment and the ability to integrate additional packages. I didn't know about dune. Looks neat. Is this meant to be used in conjunction with opam?
- djs55 8y agoYes -- opam and dune are complimentary. I normally use dune (formerly known as "jbuilder") as the build system within my packages, which I then publish and install via opam. Dune does the fast incremental builds, while opam deals with version constraint solving, downloading and general package metadata. There are some interesting experiments combining the two more closely -- take a look at "duniverse" https://github.com/avsm/duniverse https://github.com/avsm/duniverse which is a prototype system which would use opam to solve package version constraints and download the sources, allowing dune to build everything at once. The nice thing about this is that you could patch one of your dependencies and then dune will be able to perform an incremental build, as if all the code was in one big project. I'm personally hoping this will help speed up Mirage development as it can be time-consuming to propose a change to an interface and then find all the places that need changing (a cost of having lots of small repos versus a big monorepo)
- ernst_klim 8y agoLexiFi use OCaml on windows in the industrial environment (they even have a .Net integration), so the language is stable. Many packages are working fine on windows too. opam is building already I think, but is not yet stable, you could ask them on github tho. The right way to install ocaml is [1]. I don't think you can avoid cygwin completely since you need rsync and similar stuff for some packages, tho the produced binaries do not require cigwin. https://fdopen.github.io/opam-repository-mingw/ https://fdopen.github.io/opam-repository-mingw/