zamfofex / v-wasm Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://v-wasm.now.sh
Home Page: https://v-wasm.now.sh
Hello,
I tried wasi-sdk-12.0 and it gives compilation errors on macos 10.14.6.
The code:
number := 2
str := match number {
1 { 'one' }
2 { 'two' }
else { 'many'}
}
println('Value is $str')
Output:
SyntaxError: Unexpected token ';'
at Function (<anonymous>)
at HTMLButtonElement.<anonymous> (https://v-wasm.now.sh/main.js:132:34)
Hey,
I just tested playground on the same system and it works on chrome but it doesn't work on Safari.
The next code doesn't work:
fn greet() {
name := 'World'
println('Hello, $name!')
}
greet()
It returns an error:
ReferenceError: tos3 is not defined
at test (eval at <anonymous> (https://v-wasm.now.sh/index.js:1:192605), <anonymous>:45:11)
at eval (eval at <anonymous> (https://v-wasm.now.sh/index.js:1:192605), <anonymous>:50:3)
at eval (eval at <anonymous> (https://v-wasm.now.sh/index.js:1:192605), <anonymous>:51:4)
at eval (eval at <anonymous> (https://v-wasm.now.sh/index.js:1:192605), <anonymous>:55:3)
at HTMLButtonElement.<anonymous> (https://v-wasm.now.sh/index.js:1:192643)
In the same time output of a variable or a string works fine.
The code:
enum Color {
red
blue
green
}
fn is_red_or_blue(c Color) bool {
return match c {
.red, .blue { true } // comma can be used to test multiple values
.green { false }
}
}
println(is_red_or_blue(Color.red))
The output:
undefined
The following example in the V documentation
x := 123.4567
println('x = ${x:4.2f}')
println('[${x:10}]') // pad with spaces on the left
println('[${int(x):-10}]') // pad with spaces on the right
should produce
x = 123.46
[ 123.457]
[123 ]
however, in the playground the output is missing the padding:
x = 123.4567
[123.4567]
[123.4567]
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.