10 comments

  • tav 1277 days ago
    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 1277 days ago
      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 1277 days ago
    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 1277 days ago
      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 :)

      • rebolek 1277 days ago
        Describing Red as Rebol3 like is not fair IMO, it goes beyond that in many aspects - there is a compiler, C-level dialect (Red/System), reactive framework, ...

        Anyway, Arturo looks interesting and I'm looking forward to try it!

        • stchacademy 1277 days ago
          I didn't say that in a despective way at all. My only point is that Red - as far I've seen it at least - tries to maintain a great deal of compatibility with Rebol, while Arturo used it as a starting point. (Arturo can be run as valid Rebol code, only if you stick to the absolute basics)

          Even using it as an inspiration, it's obvious that I absolutely respect both projects.

          Again, what I'm trying to do is take the good points and create something completely new.

          Looking forward to hearing your feedback/ideas/suggestion/anything. I'm all ears! :)

          (Code contributions are also 100% welcome!)

          • 9214 1277 days ago
            Compatibility with either Rebol 2 or 3 is not the goal, since Red takes the best parts from both.
    • garyclarke27 1277 days ago
      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.
      • stchacademy 1277 days ago
        I've watching/studying Red for a long time. And it is a very legitimate effort to be honest. However, when trying to do too much at the same time (and attempting to build a full-stack, do-it-all language would surely qualify for that), you can easily get sidetracked.

        My attempt here is nothing too bloated. I just needed a super-flexible, easy to use (and tweak) programming language for me (automation, templates, typesetting, "quick" scripts and webview-based app publishing). So, I created it.

        It's by no means "complete" - yet. Although, after months (to years) of hard work, I think it's ready to get a bit more known. At least, my personal goal has been achieved: Arturo is the language I personally use for my everyday scripting. :)

      • 9214 1277 days ago
        Red got sidetracked by an attempt to build local economy based on an ERC-20 token, to be precise: for tipping contributors, funding FOSS projects and helping maintainers, curating high-quality learning materials within community, etc. That didn't pan out in the near term since no-one shared the enthusiasm.

        Besides, there are only a few active contributors helping the project, others, unfortunately, prefer to watch from afar and wait, or to pick Red apart feature-by-feature for other languages — and TBH I don't know if this is a historical problem with Rebol family or lack of goal-oriented communication from Red's side which would encourage people to participate (e.g. write a Postgres driver).

        • libx 1276 days ago
          I had interest in Rebol and Red, but lost it. Lost the interest because of what you mention, but also because building algorithms with it imply a big cognitive load for me. Since then, I'm very happy with TCL, one of the inspirations for Rebol. Its syntax is regular, it's a professional tool, conservative, i.e. doesn't break code at each new release, has great GUI with Tk, and many other advantages.
      • rebolek 1277 days ago
        Postgresql needs full IO support which is coming in 0.7.0, next major release. There is development branch with IO so if someone's interested, writing PostgreSQL driver should be possible today.
  • Izkata 1277 days ago
    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 1277 days ago
      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".

      • Izkata 1277 days ago
        Oh, I've used rebol 2 since like 1999 or 2000, so I got most of it, and the ".." was fairly guessable (also I've used it in bash), it's just the arrow that had me confused.

        Was also going to note the "?" in "if?" didn't make sense, due to how it's used in rebol, before finding core has both "if" and "if?", and "if?" does indeed return a boolean. Since both are there though, that does make it unnecessary in this particular example.

        However, there is one thing that could be done with "if": in arturo, it's documented to always return null, however in rebol it returns the value of the evaluated block, making "if/else" and "either" work as a ternary (and just "if" returns a none! if it was false).

        • stchacademy 1277 days ago
          Basically, the idea behind "?" is "functions that return a boolean". But done in a consistent way. So, practically EVERY function that returns a boolean is - by convention - terminated with a "?".

          Now, why the two "if"s:

          Obviously, as you yourself mentioned, 'if? returns a boolean (the result of the condition) and 'if doesn't.

          So that's one use.

          The next use - which I will obviously have to make crystal clear in the Language Reference - is that if? (with the ?) is a must if you want to pair with an "else".

          Think of it this way. If?-else may appear as a language construct, but in fact they are two separate commands. The if? is an if - that pushes the result of the condition of the stack. And "else" is actually a reversed-if: it checks what is at the top of the stack (see: returned by the if? above) and if that is false - that is: the above if-condition was not true - it executes its block.

          So, in that case, you have to use an "if?" (and not a simple "if")

          The same thing happens with a case/when? construct (only, in that case, the condition blocks are actually concatenated),e .g.

          case [x] when? [<3] [print "it was less than 3"] when? [=3] [print "it was equal to 3"] else [ print "it was greater than 3"]

          :)

          :)

        • stchacademy 1277 days ago
          Regarding if returning a value - and thus, being able to use it as part of an expression - is an absolutely interesting idea I've been thinking of implementing. However, I still don't know how.

          One idea would be to add an .attribute, e.g. if.get - and then have it return a value.

          Or, use a different function altogether.

          But then we'd have, 3-4 if's. That sounds like a bit of an overkill, I admit.

          I'm absolutely open to ideas :)

    • stchacademy 1271 days ago
      FYI, I've just published the first complete reference (language reference + full library reference, with tons of examples): https://github.com/arturo-lang/arturo/wiki

      Let me know what you think! :)

  • S4M 1277 days ago
    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 1277 days ago
      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! :)

    • stchacademy 1271 days ago
      FYI, I've just published the first complete reference (language reference + full library reference, with tons of examples): https://github.com/arturo-lang/arturo/wiki

      Let me know what you think! :)

  • lulzx 1277 days ago
    great work, quite happy to see adoption of rebol's syntax
    • stchacademy 1277 days ago
      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! :)

    • stchacademy 1271 days ago
      FYI, I've just published the first complete reference (language reference + full library reference, with tons of examples): https://github.com/arturo-lang/arturo/wiki

      Let me know what you think! :)

    • 9214 1277 days ago
      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.
      • stchacademy 1277 days ago
        No, Arturo has a wide range of built-in datatypes but no literal forms of IP addresses or URLs or e-mails or so.

        And that was a conscious choice. Having different forms of declaring literals, in my eyes simply "litters" the language.

        What Arturo does instead is use simple strings... And the interpreter internally tries to make out what they are automatically.

        For example: the 'do' function can take pretty much anything. If it is a block, it executes it. If it is a string, it executes it too - but depending on what it is. If it is a url, it executes the remote script. If it's a local file, it executes the file. If it's Arturo code, it executes it as Arturo code.

        The interpreter identifies what it is automatically. Why have different data types for that, pre-built in the language?

        • 9214 1277 days ago
          I see, so strings act as implicit "constructors" for datatypes (which are not even datatypes per se, just encoded information within a given string datatype), depending on their usage? This is indeed an interesting design choice. Rebol in such cases requires explicit conversion from string to a target type.
          • stchacademy 1277 days ago
            Yes, you are right.

            And this is the way it works throughout, with different functions - 'do' aside, that is.

            For example, there is the very powerful 'read' function.

            This may take a simple string (text), a file location or a URL. You obviously know what it is and the interpreter will figure it out itself as well.

            Now, let's say you want to read a file:

            read "myfile.txt"

            "Reading" a webpage:

            read "http://somewebsite.com/somewebpage"

            Parsing JSON from a remote source:

            read.json "http://somewebsite.com/data.json"

            Or parsing it from a string:

            read.json "[1,2,3]"

            And 'read' also can take different attributes, e.g. .csv (for parsing CSV files), .html etc etc...

            Basically you pass a string with its options and the interpreter figures out where to get it from and what to do with it... :)

            • stchacademy 1277 days ago
              Well, the main difference is that - although we do use strings (for files, urls, etc) - the appropriate datatypes are constructed implicitly, that is: no need for newFile("someFile") or %someFile. "someFile", if it is a file path, will be automatically handled as such. If it is a url, accordingly.

              The point is to keep the syntax clean. (Ok, that would be an argument of going all the way, like Tcl, where everything ends up being a string - but let's just get the best of every world without overdoing it :) )

              • 9214 1277 days ago
                Good point about Tcl, that now makes sense. Thanks for elaborating!
            • stchacademy 1277 days ago
              (I'm replying here, since I don't seem to be able to reply directly)

              @9214 Since you are knowledgeable about the topic (included but not limited to Rebol/Red), I would be glad if you joined the effort. Even testing bits here and there would be great. You're welcome :)

            • 9214 1277 days ago
              Alright, but personally I fail to see how is that qualitatively different from all the other mainstream languages that use strings as a compensatory kitchen sink to encode literals not present by default.
  • bryanrasmussen 1277 days ago
    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 1277 days ago
      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

    • stchacademy 1271 days ago
      FYI, I've just published the first complete reference (language reference + full library reference, with tons of examples): https://github.com/arturo-lang/arturo/wiki

      Let me know what you think! :)

  • jayp1418 1277 days ago
    Gtk GUI programming works? Also my platform of interest is NetBSD
    • stchacademy 1277 days ago
      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...)

      • jayp1418 1277 days ago
        Thanks for reply. I will try to build on NetBSD and let you know. nim build on NetBSD so it shouldn't be problem with that.
      • jayp1418 1277 days ago
        BTW if you want logo mascot designed for your language check this out: https://opensourcedesign.net/
        • stchacademy 1277 days ago
          Hmm... I had no idea. Thanks a lot for the suggestion :)

          P.S. A little bit of trivia: my choice of the scorpion logo was no random selection at all. Arturo was my little (well, not so little) Black Emperor scorpion that passed away in February. Hence, the name. And the logo...

          • galfarragem 1277 days ago
            The scorpion logo is fine and matches the gist of the project: Nim and Rebol are somewhat exotic but really powerful if you can tame them. My subjective 2 cents..
    • stchacademy 1271 days ago
      FYI, I've just published the first complete reference (language reference + full library reference, with tons of examples): https://github.com/arturo-lang/arturo/wiki

      Let me know what you think! :)

  • 9214 1277 days ago
  • fittipaldi76 1277 days ago
    Good job! I'll definitely have a look into it.
  • kristiann_mz 1277 days ago
    But, but, but: why ANOTHER language??
    • stchacademy 1277 days ago
      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

      • 9214 1277 days ago
        Could you please elaborate in what aspects Arthuro is ideologically inspired by Rebol, aside from minor syntax resemblance?
        • stchacademy 1277 days ago
          Easy-of-use, flexibility, blocks and dialecting, no-reserved-keywords approach, wide range of datatypes, homoiconicity - to name a few.

          That being said, as I've already mentioned, my goal was not to make a Rebol replica. Arturo is a new language.

          Now, regarding the "inspiration" part, to anyone that is familiar with Rebol, I think it would be fair to say that Arturo does look more like the Rebol group, than an Algol-type language, or ML, or Python type of language. I don't know... (I would really be intrigued to hear what it reminds you of... :))

          • 9214 1277 days ago
            My 2 cents: please add an example or two for dialecting and homoiconicity, because that's IMO not apparent from what I've seen so far (granted, I could have missed some bits), and the terms "dialecting" and esp. "homoiconicity" are so ill-defined that everyone uses them to describe different things.

            My understanding so far is that Arturo has VM-based interpreter (perhaps stack-based or even indirect-threaded, hence the mention of Forth as an inspiration) which operates on a syntax tree (either concrete or abstract, although Rebol uses the former) produced from textual source during lexing. Is that correct?

            • stchacademy 1277 days ago
              I want that too - I mean to elaborate more on these aspects with real-use examples, but I guess I'm putting it off until I deal with other small issues.

              Regarding "homoiconicity", the way I would succintly put it is that: the line between what is considered code and what is data is super-fine. Basically, anything can be anything - depending on the context. Thus, an Arturo script can manipulate its own code, the way it can manipulate any other type of data.

              Regarding Arturo's implementation: It's written in Nim (though I have written it in the past in almost every language you can think of... lol started with C++, went to D, then to Nim, back to C, and now in Nim again). Basically it's a Stack-based Bytecode Virtual Machine. And yes, Forth's influence is also important - although (intentionally) not that obvious at first sight.

              The source text is parsed to an abstract structure/tree of words and symbols. That's the part that happens in translator/parse.

              Then if it's an executable block, it is evaluated (as valid Arturo code) into Bytecode (this happens in translator/eval), and then this bytecode is executed by the virtual machine (in vm/exec).