Code Monkey home page Code Monkey logo

plzoo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plzoo's Issues

Adding link previews

Hi,
I think that adding link previews to the site could make it look better and get more attention when the site link is published to social media

image

Equip source code with locations

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?

Reorganize code for github

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.

Lexer reports incorrect line numbers

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.

Not sure the thunk implementation at runtime for levy is correct

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

Avoid read_more

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?

Toplevel directives

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.

Porting existing half-baked languages to plzoo

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?

lambda: missing reduction of terms with free variables

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

Unbound value Format.pp_print_list

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

Port `minscheme` to the zoo

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.

Source code of minscheme

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.