Skip to content

Commit

Permalink
Vlang says Hello!
Browse files Browse the repository at this point in the history
Vlang is a vlang -> c transpiler, with a wonderful toolchain around
transpilation and compilation. There is a demonstration of translating
DOOM (yes... that DOOM) from C to V and building it (in under a
second!?). It can also transpile V to javascript, or WASM. For a 5-year
old language, this is impressive.

33 to go.
  • Loading branch information
frison committed Oct 30, 2024
1 parent 9ce25bf commit e9114a4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<p align="center">
<a href="https://hub.docker.com/r/100hellos" alt="DockerHub!">
<img src="https://img.shields.io/badge/Hello%20World!-34_to_go-yellow"
<img src="https://img.shields.io/badge/Hello%20World!-33_to_go-yellow"
height="130"></a>
</p>

Expand Down
12 changes: 12 additions & 0 deletions vlang/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# syntax=docker/dockerfile:1
# escape=\
FROM 100hellos/050-c:local

RUN sudo \
apk add --no-cache \
build-base

RUN sudo \
apk add vlang --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing

COPY --chown=human:human ./files /hello-world
1 change: 1 addition & 0 deletions vlang/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../Makefile.language-container.mk
9 changes: 9 additions & 0 deletions vlang/files/hello-world.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh

# This uses the vlang REPL to build the program
chmod +x hello-world.v

# This transpiles the vlang program to C and also compiles it
# This is the slickest transpilation + compilation combo I've seen so far
./hello-world.v
./hello-world
5 changes: 5 additions & 0 deletions vlang/files/hello-world.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env v

fn main() {
println('Hello World!')
}

0 comments on commit e9114a4

Please sign in to comment.