HN user

a0

625 karma

http://rizo.odis.io

Posts29
Comments62
View on HN
twitter.com 2y ago

Docker pull implemented with multicore OCaml

a0
3pts0
anmonteiro.com 5y ago

On OCaml and the JavaScript Platform

a0
11pts0
adambard.com 8y ago

OCaml for the impatient

a0
21pts0
pusher.com 9y ago

Stream Processing with Coroutines (from C to OCaml)

a0
7pts0
en.wikipedia.org 10y ago

Unikernel

a0
2pts0
www.reddit.com 10y ago

OCamlers' critiques of Haskell

a0
177pts137
lambdafoo.com 11y ago

Unreliable Guide to OCaml Modules

a0
3pts0
blogs.janestreet.com 11y ago

A lighter Core

a0
19pts1
lambdafoo.com 11y ago

Lenses in OCaml

a0
4pts0
groups.google.com 11y ago

Simplified BER MetaOCaml N102, for OCaml 4.02.1

a0
10pts1
is-awesome.net 11y ago

Learning OCaml with Mirage OS

a0
3pts0
mads379.github.io 11y ago

OCaml Briefly

a0
138pts95
blogs.wsj.com 11y ago

For Location-Tracking Startup, a Data-Privacy Odyssey

a0
1pts0
xivilization.net 11y ago

A neat interface for Slack in OCaml

a0
1pts0
www.youtube.com 11y ago

The OCaml Platform v1.0, by Anil Madhavapeddy

a0
2pts0
anil.recoil.org 11y ago

Talks from OCaml Labs During ICFP 2014

a0
4pts0
psellos.com 11y ago

OCaml on iOS 7 Released

a0
108pts10
c10109cf-a-62cb3a1a-s-sites.googlegroups.com 11y ago

Modular Implicits – Ad-hoc Polymorphism in OCaml [pdf]

a0
3pts0
www.quora.com 11y ago

Which of Haskell and OCaml is more practical?

a0
4pts0
www.reddit.com 11y ago

Fantasy World Haskell

a0
4pts0
chaudhuri.info 11y ago

Fantasy World OCaml (2013)

a0
76pts33
haifengl.wordpress.com 12y ago

Introduction to a Functional Programming Language OCaml

a0
3pts0
opam.ocamlpro.com 12y ago

OPAM – A flexible Git-friendly package manager with multiple compiler support

a0
2pts0
nymote.org 12y ago

Nymote – Lifelong control of your networked personal data

a0
3pts0
ocsigen.org 12y ago

Eliom 4.0 Released

a0
2pts0
eyeballtrees.com 12y ago

Julia Impressions

a0
82pts59
python-history.blogspot.pt 12y ago

"The Story of None, True and False" by Guido van Rossum

a0
4pts0
vibed.org 13y ago

vibe.d - Asynchronous I/O and Web Framework in D

a0
2pts2
neverfear.org 13y ago

Secure Website Authentication Using GPG Keys

a0
9pts3

I think I don't mind lack types as much in immutable languages. Clojure and Erlang are like that. But they're also both simple languages with simple semantics.

One issue I have with Clojure is when I have to work with nested datatypes to perform transformations. It's just too hard to keep the shape of that data in your head. Types help with that.

Another important thing is modelling business domains with types. By this I really just mean record and variant types and not some advanced type-fu. It really helps seeing what kind of data your application manages.

Common reaction from them I receive very often "We never knew that JS/TS can do that"

Maybe it's about what you cannot do in ReasonML, and not about what you can do in TypeScript? :)

One problem with people selling ReasonML's type inference is that it's not depicting the actual developer experience.

The first thing to note is that you do interact with types to build a mental model! The editor will show them to you as you move your cursor around the code. It will do that for every single value. Just move the cursor over that `requestContext` argument and voilà, it'll show you the type.

Another important aspect is that you still have to define types. Have a person object with a bunch of fields? You do have to type annotate every single field. Have multiple actions to handle in reducers? You need to tell ReasonML in advance what those are using a variant type.

And finally, if you care about composition/abstraction you should provide interfaces for modules. This requires writing types for all functions explicitly to ensure that you are exposing a correct protocol. This is optional, but it helps both the author of the code and the consumers.

Type-inference is just a nice to have feature for the low-level implementation details.

Being a Vim/Merlin user I normally just type `<Leader>t` to see the type of the value under the cursor (this maps to `:MerlinTypeOf` if I recall correctly).

What I do use type annotations for is debugging. If the compiler finds a type error, in some situations it helps adding type annotations to find where the actual error is.

One place where clean build times do matter is in the CI. Having very fast builds and tests is great for speedy deployments.

This kind of comments make me really sad. Most ReasonML developers are actually "JavaScript developers".

ReasonML was specifically designed for JavaScript developers. Being JavaScript-friendly is in it's DNA really. I even see ReasonML a language that was specifically designed to work with React.

I can understand why you would feel this way though. I think the main problem is that ReasonML introduces new concepts that simply do not exist in JavaScript. Learning those concepts is hard. But if it wasn't hard, would you be learning anything or just writing JavaScript in a slightly different way?

Are there any specific examples of things that look too "distant" from JavaScript?

I'll finish this by saying that ReasonML will make you a better JavaScript developer. As will probably learning any other language that challenges the way you think.

Many interesting points! :)

Why do people care about this? Writing type annotations is not that much work (...)

I personally care about this when I'm prototyping something. Not having to write types means that I can simply write what's on my mind. The benefit of good type inference is that the compiler can still help me highlight any mistakes I made during this process.

Another benefit is that some production code can get very complex. Having to type every single value is just too cumbersome and distracting. It contributes to boilerplate and increases cognitive load, in my opinion.

Having really smart type inference makes your compiler slower and more complicated.

I would actually disagree with this. First of all, ReasonML's compiler is absurdly fast. No, seriously try it. Sometimes I go and double check the generated JS code just to be sure it actually did anything.

Regarding the "more complicated" part – the only reason why full type inference works is because it is based on a very solid theoretical foundation. It might be somewhat "complicated", but it will never be as complicated as something ad-hoc that needs to account for all inconsistencies that exist in untyped languages like JavaScript.

It's ok. There's pretty good support for linting and code completion. The plugins are fast and have a rich feature set.

Take a look at this: https://marketplace.visualstudio.com/items?itemName=jaredly....

The only problem that I have found is that in some situations it doesn't report errors correctly when adding new dependencies. Refreshing the window or rebuilding the project usually helps.

On the other hand, the compiler feels very solid. It can be annoying in the beginning because of how disciplined the code needs to be, and the error messages can be hard to understand.

After getting used to that, the dev ex is really smooth specially during complicated refactoring, the compiler and the IDE make things almost boring.

Many modern languages support type inference to some degree. The special thing about ReasonML is that the type inference is much more robust and complete.

In practice you don't need to provide any types annotations at all at any point in your program and you should still get the same safety benefits.

Every value in your code will automatically have one single type assigned to it based on how it is being used. When the compiler finds contradictions it will let you know about it. On the other hand, Typescript will try to unify the type to some sort of Any, which is probably not what you want.

In principle it seems like a significant limitation but in practice it is rarely an issue.

ReasonML does support parametric polymorphism so it is still possible to write generic code.

Some language features conveniently help to avoid boilerplate. For example it’s possible to have a `Float` module with arithmetic operators and “open” it like this: `Float.(10.0 + 0.5 / 3.0)`.

There’s also a work in progress project called Modular Implicits that will introduce ad-hoc polymorphism.

I used OCaml in production for a 2 years and it was a very pleasant experience. Recently I started using ReasonML at my team to implement a Kubernetes configuration tool. It’s surprisingly easy to use ReasonML for backend development with dune and esy.

If you want something closer to Rust, consider looking into Reason. It’s essentially OCaml with braces and semicolons.

The most unique feature is the type system which allows you to both model domain problems effectively and guarantee consistency. This reduces a huge number of bugs in compile-time.

Syntax errors are suboptimal. They are usually reported at correct location and it's relatively easy to spot them.

On the other hand type error messages are simply awesome.

I'm working on Fold – a modern functional language with lisp-like macro-system on top of OCaml.

- https://github.com/fold-lang/fold/wiki/Language-Overview

The language syntax is defined as a library and can be extended, which makes Fold ideal for DSL implementation. The powerful macro system can also be used to perform many static optimisations. My goal is to have a very flexible and performant language specially suitable for data processing.