andrejbauer / plzoo Goto Github PK
View Code? Open in Web Editor NEWProgramming Languages Zoo
License: MIT License
Programming Languages Zoo
License: MIT License
There is broken link on http://plzoo.andrej.com/language/miniml_error.html page leading to a http://plzoo.andrej.com/miniml which I believe should be http://plzoo.andrej.com/language/miniml.
andrej
,can i find for more background information?
on miniprolog, minihaskell
any pdf download and see?
thank
Here is a checklist of languages annotated with locations:
boa
calc
calc_var
lambda
levy
minihaskell
miniml
miniml_error
miniprolog
poly
sub
I guess not all need to be annotated. For example, calc
is supposed to be the most basic one in the bunch, and adding annotations goes against its purpose. What about the rest?
I am moving my PL zoo over to Github to make collaboration easier. The code right now is organized for publishing on my web site at http://andrej.com/plzoo, so the first thing that needs to be done is to change that.
I think that the lexer in many languages does not handle line numbers correctly.
For example, if I run miniml
on the following program
let f = fun f (x : int) : int is x + 1 ;;
f false ;;
it reports
$ ./miniml.native test
f : int -> int = <fun>
Type error at file "test", **line 1, charaters 44-49:**
This expression has type bool but is used as if it has type int
but the error is on the second line.
To fix it, I believe, you need to manually update the line number in the lexbuf, as I've done in my fork of the repository. I can make a pull request if you agree that it's the right call to make this change in all the similar lexers.
Hi,
I happened to be experimenting with using call by push value as part of a compiler IR for my own lazy functional language. I still don't really understand call by push value so I'm asking as much for my own learning but I don't think that the thunk implementation is strictly correct.
I mostly learned from this tutorial https://www.cs.bham.ac.uk/~pbl/papers/cbpvefftt.pdf . The way Levy presents his language a "thunk" at runtime doesn't actually need to be a closure necessarily. Thunk is just an arbitrary monad "T". T would be some sort of IO monad or something or some sort of operational monad like in https://apfelmus.nfshost.com/articles/operational-monad.html .
Basically, in my understanding of how call by push value is presented a thunk is more about delaying performing a side effect (of course nontermination is a side effect) than about delaying pure computation.
I feel like the implementation of Forcing is also a little off. In my understanding it is actually "Let" that executes the actual side effect. M is just a description of the actual side effect to be performed in my understanding.
Obviously you can shuffle things around a bit with the same end result but mostly I just want to clarify things for my own understanding.
Thanks
I explained in three blog posts (parts one, two, three) how to implement a small dependent type theory. The language tt
is suitable for the PL zoo (and in fact, I stole code from the old PL zoo to implement tt
). The repo for tt
is at https://github.com/andrejbauer/andromeda (branches blog-part-I
, blog-part-II
and blog-part-III
). Probably the part-III version is most suitable for the PL Zoo.
Hello, I noticed a small typo in the error message for syntax errors. I fixed it here: #35
Don't know if this is the sort of thing you are after, but here are a couple of toy programming languages I have found.
https://github.com/m-ender/hexagony
http://norvig.com/lispy.html
Currently, Zoo.LANGUAGE
includes read_more : string -> bool
, which is used in the interactive toplevel to determine whether further lines should be read before the input is parsed. I vaguely remember that I have seen this resolved automatically, though I do not remember how and where. Any ideas?
Here are some old sources for an imperative language comm
. It would be really good to port them to the zoo as we don't yet have any imperative languages in it. There are two variants, one with and one without arrays. Should we keep just the version with arrays?
Some languages already supported directives such as #help
, #quit
, #load file_name
and #reset
(to reset the initial environment), but they were dropped when migrating to the new interface. Which ones should we support? I guess #help
should be useful, especially if each language came with a short help message that lists the possible toplevel commands.
We still have some other languages in various stages of development laying around:
calc+var
(which I guess is an older version of calc_var
, but I did not look exactly where it diverged)comm
(a simple imperative language)commar
(a simple imperative language with arrays)dat
(mini SQL)minicalc
(again it looks like an older version of calc
)minimlcatch
(looks like miniml_error
plus error handling)minimlp
(miniml
with pairs)minscheme
(mini Scheme - without callcc
)ob
(looks like an older version of boa
)ulc
(looks like an older version of lambda
)These languages are not mature enough to put in plzoo, but could be a useful starting point for future contributions, so I would make them public. Where would be an appropriate place to put them? A subfolder, a separate branch?
Great repository. Thanks @andrejbauer.
I want to play with different reduction strategies in the lambda
language. Using the canonical example (λy.z) Ω
where Ω = (λx. x x) (λx. x x)
I got the error:
lambda -- programming languages zoo
Type Ctrl-D to exit.
(^y . z) ((^x. x x) (^x. x x))
Error at line 0, characters 6-7:
unknown identifier z
So, it seems in lambda
the reduction only work combinators (i.e. terms without free variables).
Resource is a simple language (invented by me) used for researching how easy programming can be with extra restrictions. (But you'll probably not like it.)
When I try to compile plzoo in OCaml 4.01.0 - the version that comes
with several versions of Debian - I get these errors on boa and
lambda:
File "src/boa/eval.ml", line 75, characters 4-24:
Error: Unbound value Format.pp_print_list
Did you mean pp_print_int?
File "src/lambda/print.ml", line 9, characters 2-22:
Error: Unbound value Format.pp_print_list
Did you mean pp_print_int?
Here is my compilation script - note that I've adapted it to compile
each language separately so that at least some of them would work. I
set the environment variable S to ~/snarf (long story!) but S=/tmp
should work too.
mkdir -p $S/https/github.com/andrejbauer/plzoo/archive/
cd $S/https/github.com/andrejbauer/plzoo/archive/
rm -fv $S/https/github.com/andrejbauer/plzoo/archive/master.zip
wget https://github.com/andrejbauer/plzoo/archive/master.zip
rm -Rv ~/usrc/plzoo-master/
mkdir -p ~/usrc/
unzip -d ~/usrc/ $S/https/github.com/andrejbauer/plzoo/archive/master.zip
cd ~/usrc/plzoo-master/
make calc
make calc_var
make levy
make minihaskell
make miniml
make miniml_error
make miniprolog
make poly
make sub
# These ones don't compile:
make boa
make lambda
As the title suggest, minscheme
(we should rename it to minischeme
) is a miniature version of scheme. Once added, we could also extend it with call/cc
, though one will have to redo the interpreter to support it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.