Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V: new implementation #625

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d309ea9
v: step 0
edam Feb 1, 2023
ba41c1f
v: step 1
edam Feb 1, 2023
d1d6a21
v: step 2
edam Feb 1, 2023
a4591b8
v: step 1 complete deferred
edam Feb 1, 2023
9284c82
v: step 3
edam Feb 2, 2023
a5d9f46
v updates for steps 1-3
edam Feb 2, 2023
c377ea1
v: renamed types
edam Feb 3, 2023
48b22e3
v: bugs (env, reader, unescape), added type convertion, comparison
edam Feb 5, 2023
79ee84a
v: step 4
edam Feb 5, 2023
de0b5a1
v: diferentiate between Fn and FnDef, add Closure
edam Feb 6, 2023
0f565ea
v: step 5
edam Feb 6, 2023
e95c399
v: refactor env functions and special forms
edam Feb 7, 2023
3bdc244
v: fix bug in step4, remove v workarounds, rename -d token
edam Feb 8, 2023
18c5c1e
v: step 6
edam Feb 8, 2023
bb44d7d
v: step 7
edam Feb 8, 2023
c334911
v: step 8
edam Feb 8, 2023
c845d66
v: refactor, fix eq() on Hashmap, fix keys and string representation
edam Feb 9, 2023
3c4504e
v: step 9
edam Feb 9, 2023
b3a17dc
v: fix bug in step 9 with try*
edam Feb 10, 2023
e620ad8
v: add factory fns for hashmaps, lists, vectors, fns, closures
edam Feb 11, 2023
7c0d2e0
v: step A
edam Feb 15, 2023
b751fcb
v: updated README
edam Feb 15, 2023
bbabea0
v: add to Makefie.impls alphabetically
edam Feb 15, 2023
316097d
v: add Dockerfile
edam Feb 15, 2023
f933761
v: upstream fixed some bugs
edam Feb 16, 2023
3e64e27
v: exception consistency with other mals
edam Feb 16, 2023
197439a
v: fix bug checking properly terminated strings; self hosts now!
edam Feb 16, 2023
f2f5127
v: Dockerfile fix
edam Feb 16, 2023
f4307f0
v: switch to gnu readline, fixup Dockerfile
edam Feb 19, 2023
749ce11
v: add to IMPLS.yml
edam Feb 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions IMPLS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ IMPL:
- {IMPL: sml, sml_MODE: mosml}
- {IMPL: tcl}
- {IMPL: ts}
- {IMPL: v}
- {IMPL: vala}
- {IMPL: vb}
- {IMPL: vhdl, NO_SELF_HOST_PERF: 1} # perf timeout
Expand Down
15 changes: 9 additions & 6 deletions Makefile.impls
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ wasm_MODE = wasmtime
# Implementation specific settings
#

IMPLS = ada ada.2 awk bash basic bbc-basic c c.2 chuck clojure coffee common-lisp cpp crystal cs d dart \
elisp elixir elm erlang es6 factor fantom fennel forth fsharp go groovy gnu-smalltalk \
guile haskell haxe hy io janet java java-truffle js jq julia kotlin livescript logo lua make mal \
matlab miniMAL nasm nim objc objpascal ocaml perl perl6 php picolisp pike plpgsql \
plsql powershell prolog ps purs python python.2 r racket rexx rpython ruby ruby.2 rust scala scheme skew sml \
swift swift3 swift4 swift5 tcl ts vala vb vhdl vimscript wasm wren yorick xslt zig
IMPLS = ada ada.2 awk bash basic bbc-basic c c.2 chuck clojure coffee \
common-lisp cpp crystal cs d dart elisp elixir elm erlang es6 factor \
fantom fennel forth fsharp go groovy gnu-smalltalk guile haskell haxe hy \
io janet java java-truffle js jq julia kotlin livescript logo lua make mal \
matlab miniMAL nasm nim objc objpascal ocaml perl perl6 php picolisp pike \
plpgsql plsql powershell prolog ps purs python python.2 r racket rexx \
rpython ruby ruby.2 rust scala scheme skew sml swift swift3 swift4 swift5 \
tcl ts v vala vb vhdl vimscript wasm wren yorick xslt zig

step5_EXCLUDES += bash # never completes at 10,000
step5_EXCLUDES += basic # too slow, and limited to ints of 2^16
Expand Down Expand Up @@ -188,6 +190,7 @@ swift4_STEP_TO_PROG = impls/swift4/$($(1))
swift5_STEP_TO_PROG = impls/swift5/$($(1))
tcl_STEP_TO_PROG = impls/tcl/$($(1)).tcl
ts_STEP_TO_PROG = impls/ts/$($(1)).js
v_STEP_TO_PROG = impls/v/$($(1)).v
vala_STEP_TO_PROG = impls/vala/$($(1))
vb_STEP_TO_PROG = impls/vb/$($(1)).exe
vhdl_STEP_TO_PROG = impls/vhdl/$($(1))
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ FAQ](docs/FAQ.md) where I attempt to answer some common questions.
| [TypeScript](#typescript) | [Masahiro Wakame](https://github.com/vvakame) |
| [Vala](#vala) | [Simon Tatham](https://github.com/sgtatham) |
| [VHDL](#vhdl) | [Dov Murik](https://github.com/dubek) |
| [V](#v) | [Tim Marston](http://ed.am/) |
| [Vimscript](#vimscript) | [Dov Murik](https://github.com/dubek) |
| [Visual Basic.NET](#visual-basicnet) | [Joel Martin](https://github.com/kanaka) |
| [WebAssembly](#webassembly-wasm) (wasm) | [Joel Martin](https://github.com/kanaka) |
Expand Down Expand Up @@ -1175,6 +1176,16 @@ make
node ./stepX_YYY.js
```

### V

The V implementatin of mal has been tested to work with v 0.3.3 and can
be run a follows:

```
cd impls/v
v run stepX_YYY.v
```

### Vala

The Vala implementation of mal has been tested with the Vala 0.40.8
Expand Down
1 change: 1 addition & 0 deletions impls/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,4 @@ elm/*.js
!elm/bootstrap.js
wasm/*.wat
wasm/*.wasm
*~
42 changes: 42 additions & 0 deletions impls/v/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM ubuntu:jammy
MAINTAINER Joel Martin <[email protected]>

##########################################################
# General requirements for testing or common across many
# implementations
##########################################################

RUN apt-get -y update

# Required for running tests
RUN apt-get -y install make python3

# Some typical implementation and test requirements
RUN apt-get -y install curl libreadline-dev libedit-dev

RUN mkdir -p /mal
WORKDIR /mal

##########################################################
# Specific implementation requirements
##########################################################

# fix ubuntu
RUN ln -sf bash /bin/sh

# install other tools
RUN apt-get -y install git gcc

# install v
RUN git clone https://github.com/vlang/v /v
RUN cd /v && make && ./v symlink

# install v modules
RUN v -v install edam.greadline
RUN mv /root/.vmodules /

# fix permissions
RUN find /v -type d -print0 | xargs -0 -- chmod a+x
RUN chmod -R a+r /v
RUN find /.vmodules -type d -print0 | xargs -0 -- chmod a+x
RUN chmod -R a+r /.vmodules
Loading