Better HN
topnewbestaskshowjobs
Log inSign up

padator

59 karma · joined Apr 7, 2014 (12y ago) · 37 submissions

Submissions

comment 6mo ago · link · parent

Thx a lot for the nice words pona-a. Here is my presentation of principia at the IWP9 workshop if you are interested: https://www.youtube.com/watch?v=blVTDhr4QN8

comment 3y ago · link · parent

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?

comment 4y ago · link · parent

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

comment 5y ago · link · parent

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.)

comment 5y ago · link · parent

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

comment 5y ago · link · parent

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...

comment 9y ago · link · parent

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

comment 9y ago · link · parent

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

comment 9y ago · link · parent

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

comment 10y ago · link · parent

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

comment 10y ago · link · parent

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

comment 10y ago · link · parent

You can use mk, the successor to make, which does not have the TAB requirement (you can use TAB or spaces interchangeably).

Regarding JSON, it is more verbose than Make. You need to use quote around strings, commands, everything. Compare:

foo.o: foo.c gcc -c foo.c

with

{ 'foo.o' => ['foo.c'; 'gcc -c foo.c'] }

comment 10y ago · link · parent

What about an Emacs-like editor fully written in OCaml: https://github.com/aryx/fork-efuns Easy to write an Emacs plugin then ...

comment 10y ago · link · parent

Regarding the tangle barrier issue, there is a tool that helps: https://github.com/aryx/syncweb It allows to modify both the original WEB document and code and keep them in sync.

comment 10y ago · link · parent

99% of the computer graphics you see on your screen everyday are made of simple lines, circles, curves, and text in 2D. 3D is useful mostly for games, movies, and CAD software. I don't understand this over focus on 3D. I think the latest edition of "Computer Graphics: principles and practice" does not even teach bresenham anymore. This seems wrong to me.

comment 10y ago · link · parent

There is one book doing that: http://the-knowledge.org/en-gb/the-book/ It's a great book.

comment 10y ago · link · parent

An old solution to this problem was the Logic File System https://en.wikipedia.org/wiki/Logic_File_System (disclaimer: I am one of the author).

comment 10y ago · link · parent

So I guess this medium post will eventually be part of his own list.

comment 10y ago · link · parent

Look at the ulix-book-0.13.nw file. It is the literate document. It contains all the code for the kernel.

comment 10y ago · link · parent

There are many ways to avoid the boilerplate you mention. The deriving ppx extension is one of them. I personaly used my own poor's-man-deriving called ocamltarzan which I used in pfff to factorize boilerplate by using auto-generated visitors. See https://github.com/facebook/pfff/blob/master/lang_php/parsin...

comment 11y ago · link · parent

> Using a not very popular programming language can actually make it harder for you to hire people.

Some evidence this is just not true: http://gazagnaire.org/pub/SSGM10.pdf

comment 11y ago · link · parent

OCaml had a time-traveling debugger for 20 years now. Good job catching on. (to be fair it got full stack back trace only since 2000 so far later than Perl for that).

comment 11y ago · link · parent

I use CodeMap[1] which is a kind of google maps but where the countries are the code, and CodeGraph[2] which helps to understand code dependencies at different granularities (package, module, files, functions). [1] https://github.com/facebook/pfff/wiki/CodeMap [2] https://github.com/facebook/pfff/wiki/CodeGraph

disclaimer: I am the author of those tools.

comment 11y ago · link · parent

Seems similar to what ocamldebug does in ocaml (which itself was copied from the SML debugger).

comment 11y ago · link · parent

One thing to consider though is the grepability of a codebase. By relying more on nested modules, module aliases, opens, local opens, then many constructors have more than one way to be written and it makes it harder for grep to find what you look for. Of course people should not use grep and instead rely on IDE or tools that understand deeply the programming language being edited ... which makes the problem I mentioned go away. But still it's nice to have the possibility to use simple tools like grep and that they would simply work.

comment 11y ago · link · parent

or to pfff: https://github.com/facebook/pfff

comment 11y ago · link · parent

A similar effort by Facebook open sourced 4 years ago: (I'm one of the author) http://github.com/facebook/pfff/wiki/Main with indexers for PHP, C, Java, Ocaml, and preliminary support for many other languages.

comment 12y ago · link · parent

You should try Dependency Structure Matrix. In my experience they are more scalable than other forms of software visualization. See https://github.com/facebook/pfff/wiki/CodeGraph

comment 12y ago · link · parent

Wow nice. Found http://comments.gmane.org/gmane.emacs.orgmode/32814 but I'm not sure the workflow is as convenient as syncweb. Syncweb has a unison interface to synchronize which allows to very quickly synchronize many chunks automatically. Syncweb can automatically know in which direction things need to be synchronize. If one modify the code, then the synchro will update the org, if one modify the org, then the code will be regenerated. If one modify the org, and the code at the same place, then a conflict will be detected.
12