897 karma · joined Jul 7, 2015 (11y ago) · 188 submissions
comment 6mo ago · link · parent
I would love for this Map to be expanded to modern subgenres. There are lot's of subgenres that completely changed in the last decades (notably, the *cores and the tech* ...)
And it's definitely missing Thall (https://www.youtube.com/watch?v=AtV9pcHh8vM). :D
comment 9mo ago · link · parent
When new programmer discover ML-family language, they are often stunned by how lightweight it feels, because you don't have to annotate anything. If your types are not structurally too complicated and you want something really easy to use, HM is still the nicest experience.
Naturally, it's all a tradeoff, and if you want specific features (chiefly: borrows, high-order types, overloading, or Typescript-like features), you will need to abandon complete inference (and use something like bidirectional, most likely).
comment 9mo ago · link · parent
It doesn't mean you have to use an advanced one, but your choice choose be based on knowledge, not ignorance.
A lot of harm; including the billion dollar mistake, has been done by badly designed type systems from the Java/C/C++ family.
comment 2y ago · link · parent
I've been working on memory representation of algebraic data types quite a bit, and I've always wondered if we could combine them with succinct data-structures.
comment 2y ago · link · parent
So, in fact, it's actually never algorithm W in non-toy languages. ;)
Side note: this article is originally from 2013 and is considered a must-read by any would-be hackers trying to modify the OCaml typechecker (it's cited in the documentation).
comment 2y ago · link · parent
This obviously covers type safety, but also spatial memory safety, and can be extended to temporal memory safety, and even some concurrency aspects.
This has been proven for fairly large subsets of programming languages and even some full languages (like SML). Unfortunately, it doesn't hold for most mainstream ones, because programming language theory is often ... under-used ... among language designers.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 4y ago · link · parent
The only gain from emiting C code is portability to weird architecture that would be covered by C compilers but not the OCaml one; which is arguably a pretty niche use-case.
comment 4y ago · link · parent
Instead, use Software Heritage https://www.softwareheritage.org/ , it provides unique identifiers and actually understand repositories, versioning, history, etc. It also allows you to cite the software and even give proper, durable links to point to the code.
comment 5y ago · link · parent
Property testing generates these bits using a specified distribution, and that's about it. Fuzz testing generates these bits by looking at how the program is executed, and uses a black box to try to explore all paths in the program.
Most libraries for property testing comes with very convenient ways to craft the "input to data" part. Fuzz tools come with an almost magically effective way to craft interesting inputs. The two combines very well (and have been combined in several libraries).
comment 5y ago · link · parent
However, that doesn't mean we shouldn't strive for richer feature (within the confine of regularity), or that a parsing library automatically does the job better.
For instance: intersection and complement are regular operators that works very well in regular expressions. lookahead is a regular operator (lookbehind and backreferences are not), etc. Those operators do not necessarily work at all in richer parsing libraries. When added to regular expressions, they should be well handled and optimized by regex engines (which is is currently not the case). There's still work to do, features to add, which require appropriate testing techniques.
comment 5y ago · link · parent
It is indeed quite subtle to be "productive" (that's how we say we will explore both "+"). I wrote a paper about how to do it well a few years ago, with quite a few tricks: https://regex-generate.github.io/regenerate/
comment 6y ago · link · parent
My reaction to the title was "But they are not exotic, I use them every day!"
It's definitely the feature I miss the most every time I work in other languages, even presumable "advanced" ones, like Haskell. One notable attempt to add them elsewhere is "modular C"[1].
comment 6y ago · link · parent
OsmAnd is also decent. Google map is terribly bad.
comment 6y ago · link · parent
comment 6y ago · link · parent
star (range 'a' 'z')
Naturally, it's trivial to have a `posix` combinator (or any other syntax, really), which allow you to be compact when things are trivial, explicit when they are not, or even a mix of both. You also don't have to conflate parens for priority and capture anymore, and you can create high level combinators.For instance, this is real code to build a regex parsing URLs (translated in a JS-ish syntax):
let cset = chars => compl(set(chars));
let prefix = (head, tail) => char(head) ++ rep(tail);
let scheme = rep(cset("/:?#")) ++ str("://");
let host = rep(cset("/:?#"));
let port = prefix(':', digit);
let path = rep(prefix('/', cset("/?#")));
let query = prefix('?', cset("#"));
let fragment = prefix('#', any);
let url = scheme ++ host ++ opt(port) ++ path ++ opt(query) ++ opt(fragment);
It's less compact, but it's still as fast and it's actually readable/maintainable.
It's all the advantages of Perl's regex, without having to suffer Perl's taste in syntax.comment 6y ago · link · parent
If your nodes have width, you should read "Improving Walker's Algorithm to Run in Linear Time" (I have an implementation here: https://github.com/Drup/tree_layout)
If your nodes have width and height, you need to read "Drawing Non-layered Tidy Trees in Linear Time"
If you want to go bananas visualizing n-ary trees: https://treevis.net/ :D
comment 6y ago · link · parent
With only a logic, you can't show properties about the language. In particular, we like to show that programs that are well typed avoid some errors (like segfaults), or that if an expression ( `log2(length(s))`) has a type (`int`), when you evaluate it to a value, the value (`4`) has the same type. If you want to consider such (nice!) properties, you need to consider the type system and the language together.
comment 6y ago · link · parent
One of the reason the last model is a new scale of complexity might be that it somehow use "old school" techniques: There is now collapse, no circle packing, it's just straight traditional (hard!) folding from start to finish. Creating such complex models from the traditional tools is usually really hard. It also has a certain elegance to it that is often very pleasing.
comment 7y ago · link · parent
1. Learn the theory. Yes, you need to. On this matter, the book "Types and Programming Languages" (or TAPL for short) is the bible: https://www.cis.upenn.edu/~bcpierce/tapl/
2. Implement toy type systems. There are several resources for this, but personally, I like this one: http://plzoo.andrej.com/
comment 7y ago · link · parent