8 karma · joined Oct 17, 2022 (4y ago) · 9 submissions
1.
SpellingBee-like browser game for Spanish speakers and learners(deleahora.com ↗)
39 points · by arturo-lang · 3y ago · discuss
comment 4y ago · link · parent
As for looping...
loop 1..10 'x -> print x ; prints 1 to 10
loop.with:'i ["one" "two"] 'x -> print [i "=>" x] ; 0 => one, 1 => two
do.times: 10 -> print "hello" ; print "hello" 10 times
loop.forever 1..10 'x -> print x ; prints 1 to 10, forever
loop 1..10 [x y]-> print [x y] ; print 0 1, 2 3, 4 5,...
The same works for pretty much every function in the Iterators module: map, select, filter, etc :)comment 4y ago · link · parent
Feel free to follow the project or post any questions you may have on our "official" Discord channel: https://discord.gg/YdVK2CB
comment 4y ago · link · parent
https://discord.com/channels/765519132186640445/829324913097...
comment 4y ago · link · parent
Regarding pipes,... we are working on it! :)
https://arturo-lang.io/documentation/language/#pipe-operator
comment 4y ago · link · parent
Basically, in Arturo, the two things are totally different:
- with parentheses, all you do is prioritize the evaluation of a given expression - now square brackets denote a block (of values) - one of the most basic building blocks of Arturo. And a block is not to be evaluated until we need it.
The case of `?` (which is an alias to the function `switch`) may look somewhat weird, but it follows Arturo's rules 100%. Have a look at the documentation: https://arturo-lang.io/documentation/library/core/switch/
Basically, the "normal", straightforward syntax would be:
``` a: switch 2 > 3 ["yes"]["no"] ```
Now, `-> "yes"` and `["yes"]` are exactly the same. All `->` does is wrap a single, computable value into a block (it's syntactic sugar, nothing more).
Now, why would we need parentheses in your example? (as you see, in mine, none was needed, as the order of evaluation is pretty much obvious)
if we did it without parentheses, given Arturo's right-to-left evaluation rule, it would mean something like: check if 3, if it's true, return "yes", otherwise return "no" and then compare that with 2. That's why we need the parentheses. But it's because `?` (switch alias) acts as an infix operator.
https://arturo-lang.io/documentation/language/#the-right-to-...
comment 4y ago · link · parent
Also, don't think that I have forgotten about Min either. I do keep track of its progress as well! Well done to you as well! :)
comment 4y ago · link · parent
Feel free to let me know in case you have any question - you are also welcome to post anything you may need in our Discord channel.
P.S. Regarding benchmarking, I can assure you I've been working non-stop on optimization so that the VM is as fast as possible. That being said, being an interpreted language, I don't think it could ever fare well against the compiled ones. I would mostly compare it to languages like Python, Ruby, Lua, etc :)