top | item 24834636

Show HN: Arturo – REBOL-inspired programming language and VM written in Nim

324 points| stchacademy | 5 years ago |github.com | reply

57 comments

order
[+] tav|5 years ago|reply
Great work — the functional spin on top of Rebol's clean syntax is really nicely done!

Any chance you'll be adding something like the parse function? The ability to have domain-specific dialects was one of the best things about Rebol and would be great to see in a modern language.

And speaking of functions, could you make the "Function Reference" that's on the homepage, be available on a standalone page too? It's a very useful reference and would be great to access it easily. Thanks!

[+] stchacademy|5 years ago|reply
Thanks a lot for your nice words! :)

Regarding 'parse', it's absolutely in my to-do list. Although, already, the language by its very nature has the means to do it (even you, as a user, could) - but I have to prioritize things.

Regarding reference, it's obviously a work-in-progress. However, what you mean is probably already available @ GitHub Wiki: https://github.com/arturo-lang/arturo/wiki

Have a look :)

Looking forward to hearing your feedback. Anything is welcome, ideas or suggestions :)

[+] gnud|5 years ago|reply
Looks interesting. Good job!

Another REBOL-inspired language is Red [0], which also looks interesting.

Maybe I'll actually sit down and have a proper look one of these days.

0: https://www.red-lang.org/

[+] stchacademy|5 years ago|reply
Yes, Red is another fine language. However, to be fair, I would say Red is practically like Rebol v3. Arturo's goal is not to become yet another Rebol, but combine its positive aspects (which are a lot) with other features of modern programming languages, mostly functional programming -oriented. Actually, Arturo's influences range from Rebol to Ruby, Haskell, Tcl and even Forth or Factor or... Swift.

In any case, I'm all ears for feedback/ideas/suggestions. Code contributions are more than welcome as well - it's been just a one-guy thing so far, and I can honestly not find time for everything :)

[+] garyclarke27|5 years ago|reply
I was following Red with keen interest, waiting for them to add Postgres support. Unfortunately this never happened, I think they got sidetracked by over-enthusiasm for crypto tools and thus lost momentum.
[+] Izkata|5 years ago|reply
So in this example:

  loop 1..10 'x [
      if? even? x -> print [x "is even"]
      else        -> print [x "is odd"]
  ]
I can't find any reference for what the arrow is doing. It looks like a lambda in the first part (x -> print [x "is even"]), except that would mean that's getting passed to "even?" instead of "x". But that doesn't make sense for the second one, so is the arrow part of "if?"/"else" or is it an alternate way of wrapping the print in a block? Or something else?
[+] stchacademy|5 years ago|reply
Well, it's obviously not your fault - I should have explained it better in the Language Reference (but it's a work-in-progress and I definitely will explain it thoroughly).

So...

The command "if?" takes two arguments: a boolean and a block.

Think of it like if? <something> [do something-else].

In this example, something is `even? x` and something-else is `print [x "is even"]`.

And yes, regarding the right-arrow symbol you are absolutely correct: it's syntactic sugar for wrapping a command in a block (provided that it's just ONE command - if there are more than one, you will have to use a block).

But it's still syntactic sugar as ALL symbols being used in Arturo. Pretty much like ".." is the symbol infix-alias of the command "range".

[+] S4M|5 years ago|reply
Looks great! Just one question: in the roadmap, what do you mean by "Implement LaTeX generation module"? You want to make a templating system like Sweave in R [0]?

[0] https://stat.ethz.ch/R-manual/R-devel/library/utils/doc/Swea... I haven't used it in a while, so it's the best explanation link I could find.

[+] stchacademy|5 years ago|reply
Well, the details remain to be finalized but the general idea is a generator DSL. Think of HAML in regards to HTML for example: you can write nice DSL-specific code that gets translated into valid HTML code. (There is already a relevant module for that for Arturo, thought at a very experimental level: https://github.com/arturo-lang/art-html-module).

I'm thinking of the same thing for LaTeX (and perhaps even more sophisticated). One of my main "businesses" is centered around typesetting and electronic publishing, hence I'm a heavy ... LaTeX user.

Feel free to ask anything else. All suggestions and contributions are welcome! :)

[+] lulzx|5 years ago|reply
great work, quite happy to see adoption of rebol's syntax
[+] stchacademy|5 years ago|reply
thanks a lot for your kind words. Arturo is a love child of mine and a project I've been working on in the past many years.

Rebol has absolutely been an inspiration. But I'm just trying a different take on it - a bit more flexible, more dynamic and with more modern programming language features.

Any idea/comment/suggestion or even code contribution is more than welcome! :)

[+] 9214|5 years ago|reply
Which is in fact Logo's syntax. I don't see any literal forms for IP addresses, URLs, e-mails, dates, @references and hashtags in Arturo, which are historically present in Rebol and which make it unique.
[+] bryanrasmussen|5 years ago|reply
hey, I was looking for even? in the language wiki https://github.com/arturo-lang/arturo/wiki , as in:

if? even? x -> print [x "is even"]

but I couldn't find it in Arithmetic, Comparison, Core, Logic, or Numbers - I figured those were the most obvious places to look.

I was wondering specifically if this example

loop 1..10 'x [ if? even? x -> print [x "is even"] else -> print [x "is odd"] ]

could be rewritten

loop 1..10 'x [ even? x -> print [x "is even"] odd? x -> print [x "is odd"] ]

and what other number checking things one could do - like decimal?, positive? negative?

[+] stchacademy|5 years ago|reply
Well, you have a point here: even? (and odd?) is somehow missing from the (auto-)generate docs at the wiki. I'll fix it asap. Thanks for letting me know.

Regarding the syntax:

every "function" in Arturo takes a specific number of arguments. in that case: loop, if?, even? else are ALL functions (there are no special constructs in Arturo, nor reserved keywords).

Regarding your second example/question: you could have written it like that, but it wouldn't do as you expect.

What can be done though is using the 'case function.

For any other questions, doubts, ideas or even code contribution, you're welcome to post anything at Github or via our Gitter community: https://gitter.im/arturo-lang/community or Discord: https://discord.gg/YdVK2CB

[+] jayp1418|5 years ago|reply
Gtk GUI programming works? Also my platform of interest is NetBSD
[+] stchacademy|5 years ago|reply
This is one of the main things I'm working on. For now, what does work is a webview-type of GUI application - another thing I'm very focused on.

Let me put it like this:

- Just open the REPL (Arturo's terminal) - Write: webview "Hello World!"

Although super-minimal, you already have a Webview-based GUI app with something in it. It's a starting point :)

Btw, have you managed to compile it on NetBSD? (It should run fine, I think, though I haven't tried it yet...)

[+] kristiann_mz|5 years ago|reply
But, but, but: why ANOTHER language??
[+] stchacademy|5 years ago|reply
Well, I could argue... "why not?".

Rebol - Arturo's ideological grandparent - is a great language (albeit not as well-known as it should be). And Arturo attempts to get the best bits of it and make a modern take on programming.

In the website (and the GitHub repo) you will find more than enough information about it.

Also, have a look at the wiki!

https://github.com/arturo-lang/arturo/wiki