4 ms·
great work, quite happy to see adoption of rebol's syntax
by lulzx 6y ago
great work, quite happy to see adoption of rebol's syntax
- stchacademy 6y agothanks 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 6y agoWhich 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 6y agoNo, 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 6y agoI 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 6y agoYes, 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 http://somewebsite.com/somewebpage" Parsing JSON from a remote source: read.json "http://somewebsite.com/data.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 6y 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 6y agoAlright, 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.
- stchacademy 6y agoFYI, I've just published the first complete reference (language reference + full library reference, with tons of examples): https://github.com/arturo-lang/arturo/wiki https://github.com/arturo-lang/arturo/wiki Let me know what you think! :)
- stchacademy 6y agoWell, 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 :) )
- stchacademy 6y agoFYI, I've just published the first complete reference (language reference + full library reference, with tons of examples): https://github.com/arturo-lang/arturo/wiki https://github.com/arturo-lang/arturo/wiki Let me know what you think! :)