Jump to content

Recommended Posts

2 hours ago, Kaj de Vos said:

Notepad++ has REBOL highlighting. It looks like you can use it for Meta by adding the .meta extension:

https://github.com/notepad-plus-plus/notepad-plus-plus/issues/3650

 

Or as a workaround, you could rename your .meta files to .reb extensions.

I updated my Notepad++ to the current version; and the default support for REBOL is minimal -- only supporting block collapsing; plus it doesn't seem to recognize even that with Meta code. So, I'd still like to make an attempt at setting something up myself.

 

Link to comment
Share on other sites

OK. There are some instructions for Notepad++ strewn over REBOL and Red sites, so indeed it seems to need more configuration.

 

I have been modifying and stabilising data type naming over the past months. I will start writing reference documentation for data types, and then methods and operators.

 

As the motivation for the Vim plug-in I linked says, there aren't really keywords in REBOL-style languages, but you can still make a decent attempt at, what Carl calls, lexicon colouring. First you need to recognise and colour lexical data types. You could start with that based on REBOL types. After that, you can make more distinctions between words with Meta word lists.

Link to comment
Share on other sites

16 hours ago, MrFish said:

This looks like a list of keywords to me: REBOL Quick Reference

 

Those are not fixed keywords, but functions and other words that are predefined in the built-in REBOL context, to which code is bound that is executed by the do dialect, the default functional language. Code can be bound to other contexts and be evaluated by other dialects. To know which, an editor would have to analyse a program the same way the language does.

 

The data types list in that reference is most important, because they are the lexical types that are standardised across all dialects.

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...
4 hours ago, shanti77 said:

Why does this program take up 94 sectors, it will be about 12KB?

That's correct, it's around 12 KB, and the portable binary for PC platforms is 84 KB. Why, do you think it's large?

 

3 hours ago, xxl said:

recognize zipped block headers?

List-XEX doesn't detect them, no, they didn't have those in my time. ?But I followed your compression work a bit. Is there a specification for them?

Link to comment
Share on other sites

I am glad someone considers it too big. That is why I am here, with Atari. ?On modern platforms, it's considered extremely small. I analysed a similar case here:

 

But too big for what? It's not a problem for this program. List-XEX can run on a 32 KB Atari. Meta is often as fast as assembly, but BASIC is hundreds of times slower. Yet, many programs are written in BASIC.

 

Meta is a right-level language. I have published a Rainbow demo in high-level language that produces an executable of 29 bytes for SpartaDOS X. List-XEX uses the Meta runtime to be high-level, which pulls in parts of the CC65 runtime, which leads to a complexity explosion. It makes programming a lot easier, but if it's a problem for your program, you can do it differently, for example by replacing the runtime using the integrated assembler.

 

I would consider 45 KB for chkxex on PC way too big. List-XEX for Linux is 19 KB. The version I sent to ABBUC is only 84 KB because it's the portable binary that runs on all PC platforms. But you compare List-XEX to chkxex on PC and xBootDOS on Atari. That's not the point. The point of List-XEX is that it runs on all those platforms, with exactly the same program source code.

Link to comment
Share on other sites

I thought it was about the functionality of such a program, so on atari it should be as short as possible to load quickly. I see your point is to show that one source code in that language can be compiled for different systems. The length of the object code is probably a matter of compiler optimization. The same can probably be done in Pasacal as well as in C.

Link to comment
Share on other sites

It would have been a problem in the past when everyone was using floppies, but these days, with many people using memory cards, load time is not as much of a problem anymore. Still, List-XEX has optimisation for floppy drives even without track buffers, by buffering a track in the program itself.

 

I do consider functionality important. Much functionality these days is only delivered in PC programs, often even only for Windows. Meta is thoroughly cross-platform, so if you write a PC program, it will run on all modern platforms, and with some care it will run on Atari, so you get native functionality.

 

Program size is hardly determined by compiler optimisation. It's obvious that List-XEX could be done in C, because Meta generates C. The size explosion is because C is a bad match for 8-bit machines, and the C library is a bad match for Meta's runtime. However, there is nothing better except writing it myself, and that is too much work for now.

Link to comment
Share on other sites

First, thanks for providing a new language to our old 8-bits. That is certainly appreciated. However, please allow me to re-iterate a bit on the "human readable" part you claim because I'm (as a human) failing to read the examples. (-; Sure, one has to learn every language, but so far, I had little problems even with languages beyond the Algol-family (Pascal, C, you name it...)

 

So, for example:

[qoute]third?: unless modulo counter 3 [write "Fizz"] ; Display "Fizz" every third count[/quote]

Probably defines something like a local function. I would have expected that the question mark is an indication or convention that this is some sort of boolean predicate, but that does not to be the case. Actually, it does not seem to define a predicate at all, but just a subroutine. The "logo" formulation "to third? : " would probably be clearer as it would say that this is actually a definition of "how to third". The latter would be even clearer.

 

Then, I do not understand "unless". This sounds like some sort of conditional (inverted-if) that should be followed by a binary predicate. However, that is not the case. "modulo counter 3" would in my understanding, return the remainder of "counter modulo 3", a number between 0 and 2, which is not binary. Thus, a formulation like

"unless modulo counter unequal 0" would be clearer and more readable, actually "if counter modulo 3 equals 0" would be even more readable. If that is what it means, of course. I can only guess the meaning from the comment.

 

Then, I fail to understand "any". It is probably some sort of loop, but in my interpretation of the English language, it has no implication of iteration, but rather selection, thus not clear what this does on a group of statements. If it is not some form of loop, but just grouping of statements, why not call it "group"? If that is the intention?

 

So, at least in my reading, the choice of keywords is not very wise, and the syntax is not as readable as it could be.

 

Link to comment
Share on other sites

THIRD? in the FizzBuzz example is just what you thought: a variable where the ? is just a naming convention for a boolean predicate (type LOGIC!). It's nothing as complex as a local function or a subroutine. The fact that your first inkling was right seems human-friendly to me. ?

 

UNLESS is also what you thought: just inverted IF. That they take an integer expression is a small optimisation I added, which many are familiar with from C style languages, which do it all the time. In many cases it reads quite naturally, particularly in cases where an expression can be NONE (NULL in C), but in cases where it doesn't, you can just write IF IS-ZERO. Linguistically, a zero amount of something is nothing, so you can read it like "unless counter modulo 3 yields something".

 

Again, ANY is what you thought: selection, not a loop (although it is a declarative loop in the REBOL PARSE dialect, but that is some way off). It's basically the prefix equivalent of short-circuit infix or operators such as || in C. It looks different, but it's not terribly special.

 

What is a GROUP! in Meta (PAREN! in REBOL) is just (). A list of expressions, simply returning the value of the last. No selection.

 

Meta is different from popular languages, so you need to get used to it. Algol-based languages hardly prepare you for it, they mostly confuse matters. I advise you to start with Atari Logo, and then study REBOL. It also helps to distance yourself from the programming languages you know and think more of human language. If you make that effort, you will start seeing how Logo, REBOL and Meta are very logical and consistent in themselves. It doesn't help to project conventions from other languages on them.

Link to comment
Share on other sites

On 8/3/2022 at 9:13 AM, shanti77 said:

Why does this program take up 94 sectors, it will be about 12KB?

 

These are the ones I have in my collection:

F(ile)trace by Compyshop Magazin, original version 5 sectors, updated version 7 sectors.

File/Disk Info by Leon (Tajemnice Atari magazine) 18 sectors.

File Digger V1.1 by S. Igielski 10 sectors

COM-Tool 1.0 by Frankenstein 18 sectors.

PRocess OBJect file 66 sectors (compiled language, maybe compiled Basic)

 

File Digger and PROBJ do not only show the data segments of a file, they can also remove certain data segments, if wanted.

In Turbo-DOS XL/XE by Reitershan this function is built-in, one can simply type HEA FILENAME.EXT to show all segments, in X-DOS by S.Dorndorf this is also built-in, one can type MAP FILENAME.EXT to show all segments. I guess that SpartaDOS and SDX also have tools available to show the data segments of a file.

 

 

Link to comment
Share on other sites

On 8/3/2022 at 7:39 PM, Kaj de Vos said:

THIRD? in the FizzBuzz example is just what you thought: a variable where the ? is just a naming convention for a boolean predicate (type LOGIC!). It's nothing as complex as a local function or a subroutine. The fact that your first inkling was right seems human-friendly to me. ?

 

UNLESS is also what you thought: just inverted IF. That they take an integer expression is a small optimisation I added, which many are familiar with from C style languages, which do it all the time. In many cases it reads quite naturally, particularly in cases where an expression can be NONE (NULL in C), but in cases where it doesn't, you can just write IF IS-ZERO. Linguistically, a zero amount of something is nothing, so you can read it like "unless counter modulo 3 yields something".

 

Again, ANY is what you thought: selection, not a loop (although it is a declarative loop in the REBOL PARSE dialect, but that is some way off). It's basically the prefix equivalent of short-circuit infix or operators such as || in C. It looks different, but it's not terribly special.

 

What is a GROUP! in Meta (PAREN! in REBOL) is just (). A list of expressions, simply returning the value of the last. No selection.

 

Meta is different from popular languages, so you need to get used to it. Algol-based languages hardly prepare you for it, they mostly confuse matters. I advise you to start with Atari Logo, and then study REBOL. It also helps to distance yourself from the programming languages you know and think more of human language. If you make that effort, you will start seeing how Logo, REBOL and Meta are very logical and consistent in themselves. It doesn't help to project conventions from other languages on them.

Yes, but where is the value of the predicate THIRD? ? I only see the instructions/statements it executes, namely within the [ ] brackets. Same goes for ANY. Probably it is a selection, but how is the selection made and by which criterion. I understand that one need to learn things, but the language syntax should provide some indication or hints on what things are meaning.

I'm not against "C-style" shortcuts, but those are not very "readable" either. It's just a stupid convention for a language that is more a high-level macro-assembler, a convention that made sense at times when code optimization was essentially non-existing.

Link to comment
Share on other sites

49 minutes ago, thorfdbg said:

It's just a stupid convention for a language (...)

you don't get it! :D

 

Quote

“For my thoughts are not your thoughts,
    neither are your ways my ways,”
declares the Lord.
“As the heavens are higher than the earth,
    so are my ways higher than your ways
    and my thoughts than your thoughts.

Isaiah 55:8-9

  • Sad 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...