Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Drup
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
61.
▲
by
Drup
8y ago
If you want to grok monads as an OCaml programmer, there is a very simple solution: do some concurrent/system programming. Both Lwt and Async are monadic, but they are presented without requiring you to know about monads, so you can ge
62.
▲
by
Drup
8y ago
Inferring the most generic type in the presence of polymorphic recursion is not decidable. It's not that HM has a problem with it, it's just plain not possible. OCaml and Haskell support it by requiring type annotations. In genera
63.
▲
by
Drup
8y ago
As far as I'm concerned, the minimal is sum, products and, most importantly, abstract parametric datatypes. This is sufficient for phantom types, and then the fun starts. More complex parametric types (with ad-hoc polymorphism for exam
64.
▲
by
Drup
8y ago
Well, the reason you gave are valid, but it also highly depends on the task at hand. You say AAA game engines are the most complex programs you can think of .... I raise you production-grade compilers, and those benefits enormously from com
65.
▲
by
Drup
8y ago
The french elections don't use any form of electronic voting system. The interference is given a passing mention with no source whatsoever, what is it talking about?
66.
▲
by
Drup
9y ago
The goal post, right from the start, is that by having proper abstraction (the kind that doesn't break when you blow lightly on it), you get many benefits. You say that, even when the language doesn't enforce it, people don't
67.
▲
by
Drup
9y ago
Ah, yes, This is where safety and security differs! Abstraction is about safety: preventing errors and giving additional guarantees, not preventing attacks. :) Nothing I said hold when people are being malicious: Even in OCaml, you have es
68.
▲
by
Drup
9y ago
I don't know all that much about C++'s object system, so I can't give you a concrete example on how it breaks down. However, you say that it is "not something people do" ... well maybe not in C++ (I highly doubt tha
69.
▲
by
Drup
9y ago
I didn't say anything about types. :) I said functionally equivalent . What it means depends on the definition of "functionally equivalent" of course. The first version, which is types, is the most immediate and obvious, b
70.
▲
by
Drup
9y ago
There is no abstraction in C++, you can always poke around the memory layout of what you are given, and change your behavior depending on that. For example, let us say you have a module satisfying this signature: module M : sig type
71.
▲
by
Drup
9y ago
This is a good rundown of the basics of ML modules, the syntactic aspects, if you will. But it doesn't really give you the important insight: Abstraction. is. powerful. if you consider the IntMap module provided in the article,
72.
▲
by
Drup
9y ago
> in the US at least There is scientific research done outside the US, and they even have PHD students. ;) This class is perfectly good for most of Europe, as highlighted by the Readme. Most of the time, the only thing that is imposed is
73.
▲
by
Drup
9y ago
I wrote my (phd) thesis recently, which mean I got to do a survey of the various templates for that purpose. KOMAscripts wins, hands down. This is cute, but KOMAscript is just ridiculously featureful and customizable. It's also very we
74.
▲
by
Drup
9y ago
If you want to have fun, I also have a small tutorial on how to make a typesafe printf function with GADTs (and that technique is actually used in the OCaml stdlib!) https://drup.github.io/2016/08/02/difflists
75.
▲
by
Drup
9y ago
I know, hence my question! Why go through bs (which is locked to an old version of OCaml) to distribute executables, when you can use the normal compiler and enjoy the latest improvements?
76.
▲
by
Drup
9y ago
> This should be possible with something like bsb-native ( https://github.com/bsansouci/bsb-native ) Why not just use the real OCaml/Reason compiler ... ?
77.
▲
by
Drup
9y ago
The "inlined" record can only be accessed locally and can not be returned as a single value (See manual here: http://caml.inria.fr/pub/docs/manual-ocaml/extn.html#sec271 ). In general, multiple types
78.
▲
by
Drup
9y ago
> Also, the lack of namespacing. In Rust, the enum variants are scoped to the name of the sum type. But in ML you will often see people using explicit prefixes like in C, to provide your own namespacing. (At least, I saw this in the earl
79.
▲
by
Drup
9y ago
Do you have concrete examples of things you are missing?
80.
▲
by
Drup
9y ago
This is true as long as you stay in the language. When you start binding to JS libraries, all hell break loose and you have to track down undefined and nulls that slip into places they shouldn't, because most JS libraries are poorly wr
81.
▲
by
Drup
9y ago
Sure. Just like somewhere , you have to define the semantics of + on the various primitive in your lisp-based system. Oh, surprise, you do that with a typecase/runtime type check. There are genuine arguments between static and dynamic
82.
▲
by
Drup
9y ago
let plus x y = x + y This is a statically typed function. If you are going to talk about static typing, learn about type inference and avoid making yourself ridiculous. Also, the fact that types are dynamic doesn't mean you do
83.
▲
by
Drup
9y ago
I was looking for a way to turn my (soon-to-be-defended) PhD thesis into an epub, and investigated the various LaTeX2Html converters. I was pretty disappointed when I realized that all of them are terrible and have no hope of handling my ma
84.
▲
by
Drup
9y ago
Tierless programming languages did not started nor ended with Opa. Eliom is very well alive and kicking (disclaimer: I'm finishing my PHD on the topic), as well as Hop, Split.js, Ur/Web, Links, Websharper, ... I was always very di
85.
▲
by
Drup
9y ago
While Mathematics is type aware, Mathematicians often aren't. They mix things that are "not the same object, but almost, I swear", and constantly write ill-typed expressions. This is generally on purpose, to avoid making expl
86.
▲
by
Drup
9y ago
The QPL is not used anymore. The OCaml compiler is GPL, the OCaml standard library is LGPL with the OCaml linking exception and the license of produced binaries is whatever the author wants. If you still have issues with that .. I would rea
87.
▲
by
Drup
9y ago
OCaml's _type_ system is not turing complete (unless you have a new striking example to provide, but this would be considered a critical soundness bug). There are two undecidable bit in OCaml's typechecker: 1) Checking module typ
88.
▲
by
Drup
9y ago
Regex combinators are quite common in functional languages (where it works quite better than in python). One particular advantage compared to Regex syntax is that you stay inside the language and only use function calls, so you get the docu
89.
▲
by
Drup
9y ago
I believe you get an actual interest for type systems when you start using a rich one. Unfortunately, most mainstream languages have very poor type systems. In particular, it will come naturally over time if you start using languages like O
90.
▲
by
Drup
9y ago
As someone who does origami, that zigzag fold is absolutely fantastic: http://media.npr.org/assets/img/2017/05/19/origami-pic_custo... I'm really curious how evolution figured that one.
More ›