Readit News logoReadit News
padator commented on Typical: Data interchange with algebraic data types   github.com/stepchowfun/ty... · Posted by u/g0xA52A2A
padator · 2 years ago
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?
padator commented on Writing a Game Boy Emulator in OCaml   linoscope.github.io/writi... · Posted by u/yakshaving_jgt
padator · 4 years ago
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
padator commented on Show HN: Semgrep App    · Posted by u/underyx
frellus · 4 years ago
Most of it written in OCaml, cool! What made you pick OCaml as the primary language to use for the business logic?
padator · 4 years ago
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.)
padator commented on Show HN: Visualizing a Codebase   octo.github.com/projects/... · Posted by u/wattenberger
padator · 4 years ago
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

padator commented on The Mercury functional programming language   mercurylang.org/... · Posted by u/pabs3
FridgeSeal · 4 years ago
This seems pretty cool, but I don’t really understand the function-mode concept, does anyone have a good explanation of what it is or why it’s a feature?
padator · 4 years ago
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...
padator commented on Green Threads Explained   c9x.me/articles/gthreads/... · Posted by u/terminalcommand
baruch · 8 years ago
Are there actual examples of green threads that are not cooperative?

All the implementations I've seen are cooperative.

padator · 8 years ago
OCaml uses green threads where you can cooperate (yield()) or be preempted every 50ms.
padator commented on Dentsu CEO resigns after overworked employee commits suicide   money.cnn.com/2016/12/29/... · Posted by u/wjossey
padator · 9 years ago
Suicide seems a bit extreme. Could she not just quit? Also everyday people commit suicide. Why do we blame CEOs for that?
padator commented on Codebase Refactoring with Go   talks.golang.org/2016/ref... · Posted by u/junke
jcrites · 9 years ago
I think it's fantastic that this problem has people's attention.

I have long wished that code changes to a repository could be accompanied by code refactorings that are intended to be applied to code using that repository. For example, if you rename f() to g(), then you could accompany this by a refactoring that transforms existing callers of f() to use g() as well. I'd envision this as a build step that tells you that automated repairs are available.

The refactoring could be a small but limited program of its own, that is evaluated against the program abstract syntax graph, and that can be as powerful as is warranted or needed to properly transform programs using the code. Moving or renaming code could be a relatively simple type of refactoring. However, if you've renamed f(int) to g(int, int) such that callers of f(N) should call g(N, 0), then a slightly more complex refactoring script could handle that too. I would think of these refactoring scripts as something like how Git treats changes during a rebase: if you are far behind you might need to apply multiple of them to your code base in sequence to bring code up to date.

The article points out an important need for gradual repair to be possible. Along with a way to express that transition backwards-compatibly for a period of time, an automated way to apply the refactoring steps could make adoption even easier. In this fashion, refactoring and improvements could have far lower costs for libraries, APIs, etc. than they do in today's languages.

padator · 9 years ago
There is one such tool for C: coccinelle http://coccinelle.lip6.fr/
padator commented on Gosubc – An implementation of the SubC language in Go   github.com/qeedquan/gosub... · Posted by u/vmorgulis
padator · 9 years ago
So? Is it shorter? How much shorter? How does Go improve over C? Just curious.
padator commented on 500 Lines or Less – A Python Interpreter Written in Python   aosabook.org/en/500L/a-py... · Posted by u/gkst
nickpsecurity · 9 years ago
Look up femtolisp. It's a fast interpreter that was around 1kloc at one point. Julia is built on it. It was LISP internally last I checked.
padator · 9 years ago
I count more than 30 000 LOC at https://github.com/JeffBezanson/femtolisp

u/padator

KarmaCake day59April 7, 2014View Original