Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
octachron
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
octachron
7mo ago
Not really when reading `iter (printf %"d %d" m) ns`, I am likely to read it in three steps - `iter`: this is a side-effect on a collection - `(printf`: ok, this is just printing, I don't care about what is printed, let
2.
▲
by
octachron
7mo ago
The issue is that the C memory model allows more behaviours than the memory model of x86-64 processors. You can thus write code which is incorrect according to the C language specification but will happen to work on x86-64 processors. Movin
3.
▲
by
octachron
8mo ago
Note that OCaml has monadic `do` too, in the form of `let*` operators (and applicative `and`) since OCaml 4.08.
4.
▲
by
octachron
8mo ago
OCaml has structural variants in the form of polymorphic variants. On the product side, OCaml has objects, first-class modules, labelled tuples (since OCaml 5.4) which are all a form of structural records, with different trade-off in term o
5.
▲
by
octachron
10mo ago
For a bounded size of types of sub-expressions, HM inference is quasi-linear in the size of the program, because the constraints appearing in the HM algorithm are only equality between meta-variables.A NP-complete SAT solver is not really a
6.
▲
by
octachron
11mo ago
Nearly the same as with positional argument: Partially applying a function to a named argument creates a closure with this argument filled in, and you can apply the argument in whichever order you want: let f a ~x ~y b = a + x + y + b
7.
▲
by
octachron
1y ago
A point that I find missing in the timeline for dynamic array is that there have been implementation for dynamic arrays available in libraries for more than twenty years. However, none of the authors of those libraries were really happy wit
8.
▲
by
octachron
1y ago
> This introduction doesn't really explain anything, as I guess it assumes you've learned OCaml elsewhere and are just here to practice. Indeed the link is a not an introduction to OCaml but a demo instance of Learn-ocaml which
9.
▲
by
octachron
1y ago
You are misreading the quantification, a value l of type List a means that for all type a, the element of the list has type a. In other words, this is an universal quantification whereas your interpretation is an existential quantification.
10.
▲
by
octachron
1y ago
Return (or other effects) does make sense as an expression in a functional language. Typically, OCaml has `raise Exception` which is also an expression, with the same type as `return` or any never returning function. And exceptions can also
11.
▲
by
octachron
2y ago
A significant factor in my experience is that a lot of programs are quite similar from an compiler perspective: they use well-trodden set of features and combine then in a predictable way. Compiling those regular programs is well-tested and
12.
▲
by
octachron
2y ago
Note that this is an error message from the ocamldoc tool, and not an error message from the OCaml compiler itself. Funnily enough, looking that the repository history, this French error message was introduced in the very first version of o
13.
▲
by
octachron
2y ago
How long ago was this "relatively recently"? When I translated all the remaining French comments in the OCaml compiler nearly 10 years ago, there were already no warnings nor error messages in French.
14.
▲
by
octachron
2y ago
Mathematicians are more interested in the gap in our proof framework. Like stated in the articles, many "interesting" constants appearing in mathematics feels like obviously irrational. However, proofs that they are irrational hav
15.
▲
by
octachron
2y ago
This is only true for distributions with finite variance (and the edge case of distribution with slowly growing infinite variance). And for a given variance, gaussian distributions are exactly the maximal entropy distribution.
16.
▲
by
octachron
2y ago
The variable "x" would be a list in this case. This the GADT (Generalized Abstract Data Types) syntax, where the type of the whole union can depend on the discriminated union case. Thus List_name: 'a list -> ('
17.
▲
by
octachron
2y ago
Ocaml object system can also achieve this in a quite lightweight way type foo = < foo:int > type bar = < bar:int > type k = < foo; bar > type u = < k; baz:int > let f (x: <u; ..>) (\* the
18.
▲
by
octachron
2y ago
The Everest project did publish a proved TLS implementation: https://mitls.org . And at least the EverCrypt* cryptographic primitives has been used outside of academia.
19.
▲
by
octachron
2y ago
F* has an extraction backend which targets "human-readable C" code, contrarily to Coq which extracts proof to "machine-written OCaml" (typically the extracted code use a type-system-escape-hatch left in OCaml for the sak
20.
▲
by
octachron
2y ago
Adding type annotations in OCaml never reduce the typechecking time: it adds more information for the typechecker to process and it can only increase the size of type. Typechecking time is proportional to the size of types but those tends t
21.
▲
by
octachron
3y ago
Note that OCaml has been using autoconf since OCaml 4.09.
22.
▲
by
octachron
3y ago
Predictions of the solar system state are accurate only on "short" periods. The solar system is chaotic, and predicting its state after few million years is no more possible that predicting the weather for next year. This does not
23.
▲
by
octachron
3y ago
Ok, now I understand: this part is a description of how optimizing C bindings using the OCaml FFI often requires to play around the GC: With OCaml uniform representation of data, the GC will follow all data that looks like a pointer in its
24.
▲
by
octachron
3y ago
Of course not. Honestly, I am not sure what was the initial sentence before being distorted by the editor. The next sentence makes me think that the interviewee might have been discoursing about all the tricks that Janestreet uses to reduce
25.
▲
by
octachron
3y ago
No, OCaml compiles polymorphic functions once by using an universal representation of values which tends to play better with a type system with recursively polymorphic functions, higher-rank polymorphism or existential types (which all impl
26.
▲
by
octachron
3y ago
For GADTs heavy programs, it depends a lot on how much work the exhaustiveness check for pattern matching is doing behind the scene: With GADTs, one can encode a Turing machine in the type system. In that pathological case, analyzing that a
27.
▲
by
octachron
3y ago
Fast (and principled) inference for not-too-complicated polymorphic types is an explicit design goal for OCaml and Haskell languages. And this design goal constraint quite a lot the type system. Typically, there are many type system feature
28.
▲
by
octachron
3y ago
The OCaml object system is still parametric polymorphism (trying to pass itself as subtyping polymorphism through row variables) rather than ad-hoc polymorphism: there are still no functions that only work on a finite subset of types. In ot
29.
▲
by
octachron
4y ago
In this comparison, "purer" more often than not means that the choice simplified the formalization of SML. And for the context, many people from the OCaml side considers that the SML formalization has been for a good part responsi
30.
▲
by
octachron
4y ago
I am not sure how F# which started as a .NET version of early OCaml 3 can be seen as a modernized OCaml 5? Even more so when F# has to give up on some OCaml core feature in the transition (before growing in its own language of course).
More ›