Hacker Newsnew | past | comments | ask | show | jobs | submit | padator's commentslogin

What is the difference with ATD: https://atd.readthedocs.io/en/latest/atd-project.html which also was designed with algebraic data types in mind?


I can't speak with authority about ATD, but the following might be helpful:

Aside from algebraic data types, the big selling point of Typical is asymmetric fields. That's the crucial feature that distinguishes Typical from every other framework. Without asymmetric fields, there is no safe way to introduce or retire required fields. People using other frameworks fear required fields (rightly so), whereas Typical gives you the tools to embrace them.


Not sure you really need GADTs for the instruction set. A separate arg8 and arg16 ADT types would be enough, so you would have | Add8 of arg8 * arg8


Hi, author here. Yeah, I thought the same and tried that too, but it failed due to the same reason mentioned in the "Problem with the definition using variants" section. Namely, the return value type of `read_arg` would not be uniquely determinable. We CAN define separate `read_arg8` for `read_arg16` for the `arg8` and `arg16` respectively, but I thought the GADT solution was more clean.


Why OCaml? It's a great language to write programs that works on complex data structures, e.g. ASTs. This choice was actually not very original: people in academia at stanford, berkeley, Microsoft research used OCaml for program analysis (CCured, Saturn, CIL, SLAM). And now and now the industry is also using it (Facebook Infer, Facebook Hack/Flow/Pyre, MS Static Device Verifier, etc.)


To add some context, padator is on the Semgrep team; he’s the person I referenced as

> One of our team members at r2c came up with a novel approach to this problem: he suggested reusing some of his old work on Coccinelle[3] and later Sgrep[4]


Shameless plug, but this was also showing the content of the file! https://github.com/facebook/pfff/wiki/CodeMap

There are lots of examples of OSS projects visualized here: https://github.com/facebookarchive/pfff/wiki/Examples


I think it's more related to Prolog than functions. In prolog you can use a predicate in many ways. For example append(L1, L2, L3) declared that the concatenation of the list L1 and L2 result in L3, but you can use it in a "reverse" way too (thx to Prolog awesomeness) like append(L1, L2, [1,2,3]) and Prolog will enumerate all possibilities for L1 and L2. This can be slow though, and I think 'mode' is a way to declare all this different way to use prediate (in, int, out), (out, out, in), etc. and maybe compile things efficiently. See https://www.mercurylang.org/information/doc-latest/mercury_r...


OCaml uses green threads where you can cooperate (yield()) or be preempted every 50ms.


Suicide seems a bit extreme. Could she not just quit? Also everyday people commit suicide. Why do we blame CEOs for that?


You're right! Suicide is very extreme. That's kind of the problem that's being discussed.


And never have another job again?


And? Is that any reason to kill yourself?


There is one such tool for C: coccinelle http://coccinelle.lip6.fr/


So? Is it shorter? How much shorter? How does Go improve over C? Just curious.


I count more than 30 000 LOC at https://github.com/JeffBezanson/femtolisp


I was going by the original description. No longer true it seems. I'll retract it then. Thanks. :)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: