Jump to content

Recommended Posts

3 hours ago, thorfdbg said:

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.

In most Atari languages, we are used to thinking in instructions/statements. But in many other languages, including Meta, we should think in expressions. Every expression returns some value. A statement is just an expression of which the value isn't used.

Third?: unless modulo counter 3 [write "Fizz"] ; Display "Fizz" every third count; remember whether we did

Even control flow constructs such as unless are expressions that return a value. The type of the value is inferred by the combination of expressions. unless is a decision construct, so the decision expression is inferred to be logic!. write doesn't produce a return value, but it's still an expression, so it returns nothing! (unset! in REBOL). Normally, unless returns the value of the code block, but because that is nothing!, the return type of unless can be inferred as logic!. This is assigned to third?, so that variable is also inferred to be logic!. And that is how it gets its value: the result of the unless decision.

 

It could also be programmed as:

Unless third?: modulo counter 3 [write "Fizz"] ; Display "Fizz" every third count; remember whether we did

but it would violate the logic! convention for ? a bit, and I made it consistent with the use of unless in the following any.

Any [
    unless modulo counter 5 [write "Buzz"]  ; Display "Buzz" every fifth count
    third?  ; Remember earlier result
    write counter ; Display the number if not third or fifth
]

The code block here has three expressions. any executes as many of them until one returns a useful value: that is, not false, none or 0 for an integer expression.

 

It could also be written as:

    Unless any [
        unless modulo counter 5 [write "Buzz"]      ; Display "Buzz" every fifth count
        third?                                      ; Remember earlier result
    ][
        write counter                               ; Display the number if not third or fifth
    ]

but in REBOL it's common to simplify it to the above form.

 

Most of these principles are discussed in the REBOL documentation, for example here:

http://www.rebol.com/docs/core23/rebolcore-4.html#section-6

You really need to study that to understand how Meta works, if you are not familiar with these types of languages.

 

4 hours ago, thorfdbg said:

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.

Do you mean is-zero not being mandatory to use an integer expression as logic!? I considered your side of the argument for a long time, and REBOL takes that side. Many other languages, such as C, Python and JavaScript, allow leaving out some type casts in cases where it's clear what you mean. I allowed it when I saw that, as I said earlier, some code reads more naturally that way. Code optimisation doesn't factor into that decision (I'm doing that optimisation, in any case). Again, it's not mandatory, so it's up to the programmer to choose the form that reads more naturally in a given situation.

Link to comment
Share on other sites

4 hours ago, Kaj de Vos said:

In most Atari languages, we are used to thinking in instructions/statements. But in many other languages, including Meta, we should think in expressions. Every expression returns some value. A statement is just an expression of which the value isn't used.


Third?: unless modulo counter 3 [write "Fizz"] ; Display "Fizz" every third count; remember whether we did

Even control flow constructs such as unless are expressions that return a value. The type of the value is inferred by the combination of expressions. unless is a decision construct, so the decision expression is inferred to be logic!. write doesn't produce a return value, but it's still an expression, so it returns nothing! (unset! in REBOL). Normally, unless returns the value of the code block, but because that is nothing!, the return type of unless can be inferred as logic!. This is assigned to third?, so that variable is also inferred to be logic!. And that is how it gets its value: the result of the unless decision.

 

It could also be programmed as:


Unless third?: modulo counter 3 [write "Fizz"] ; Display "Fizz" every third count; remember whether we did

but it would violate the logic! convention for ? a bit, and I made it consistent with the use of unless in the following any.


Any [
    unless modulo counter 5 [write "Buzz"]  ; Display "Buzz" every fifth count
    third?  ; Remember earlier result
    write counter ; Display the number if not third or fifth
]

The code block here has three expressions. any executes as many of them until one returns a useful value: that is, not false, none or 0 for an integer expression.

 

It could also be written as:


    Unless any [
        unless modulo counter 5 [write "Buzz"]      ; Display "Buzz" every fifth count
        third?                                      ; Remember earlier result
    ][
        write counter                               ; Display the number if not third or fifth
    ]

but in REBOL it's common to simplify it to the above form.

 

Most of these principles are discussed in the REBOL documentation, for example here:

http://www.rebol.com/docs/core23/rebolcore-4.html#section-6

You really need to study that to understand how Meta works, if you are not familiar with these types of languages.

 

Do you mean is-zero not being mandatory to use an integer expression as logic!? I considered your side of the argument for a long time, and REBOL takes that side. Many other languages, such as C, Python and JavaScript, allow leaving out some type casts in cases where it's clear what you mean. I allowed it when I saw that, as I said earlier, some code reads more naturally that way. Code optimisation doesn't factor into that decision (I'm doing that optimisation, in any case). Again, it's not mandatory, so it's up to the programmer to choose the form that reads more naturally in a given situation.

Actually, C is all over for expressions, and the only way how to create a statement is to append a semicolon to an expression. That's all fine with me. What I find rather opaque is that apparently the "value" of the "modulo 3" expression is not taken as an argument of "unless" (as one would expect), but "survives" it and the following group as nothing else overrides it there. At least this is what I get from your explanation. The problem I have here is that, as far as "value flow" is concerned, the expression "modulo 3" is connected to a sort of "T-junction" whose one end goes into "unless" and whose other end goes to the return of the function. There is no syntactic sugar to indicate this flow, and that's confusing.

 

The same goes for "any" - I'm even more confused now as apparently there are expressions within the "any" construct that do not have a value, even though the expression behind "unless" has one. Thus, in which case an expression after unless is forwarded as output or not is again quite opaque to me.

 

Let's put this the other way around: Maybe there is some advantage for the compiler that the language works this way, something that eases optimization or code generation, but I don't quite see that at the moment.

 

Again, please don't get me wrong. I'm not say that "Basic is the right language". Actually, there are so many things wrong about it, and I've stopped using that several decades ago. It's mostly C++ and python these days, and I neither have a problem with Lisp. But what is obvious in all these languages is how "values flow" or how program execution flows.

 

Neither anything against "fun with computer languages". I made one up myself, which successfully combined the drawbacks of BCPL and Basic and was meant to create very unreadable programs because you could even overload language constructs in the language itself, such as "if" or "return". But it wasn't meant to be practical to begin with (except being a practical joke). So, potentially, I'm either not getting the language or the joke, whatever applies (and sorry, it's not meant to be provocative).

Link to comment
Share on other sites

@thorfdbg your not alone, I consider myself to be a pretty accomplished programmer having been in the industry

 since about 1980 and have had to master many, many languages, operating systems etc. but this Meta never

seem to make any sense.

 

I can usually look at other languages and at least get an idea of what's going on, but not this one (maybe I'm getting old :) )

 

And as @zbyti and others have indicated, without suitable documentation, it's rather pointless trying to profess how good and

"human readable" this language is if you don't have the first inkling of how it all hangs together.

 

Maybe advertising this was a bit premature.  

 

Link to comment
Share on other sites

@thorfdbg, no offence taken. I'm trying to analyse your feedback to see if there is anything in there that warrants changing the language, or if I can somehow formulate documentation to address these concerns. However, the REBOL design has been meticulously thought out for more than three decades, so usually I end up making only small tweaks. What's completely different in Meta is the implementation.

 

What I must keep repeating, is that these are all basic questions, that can simply be answered by reading the REBOL documentation. Most people who don't know REBOL seem to prefer to avoid the documentation at all cost and make up their own misconceptions. We know that as RTFM, we know it doesn't work, and writing more documentation doesn't solve this problem, either.

 

For example, I agree that your proposal of

counter modulo 3 equals 0

would be closer to English, and have a nice linear execution order. Meta is able to implement any language, so it could be done by making modulo and equals operators. This could be done with all binary methods. There are several reasons why this is not done in the default functional language dialect:

  • Not all binary methods are eligible, for example if condition [statements]. It can't be a general rule.
  • There already are operators to achieve this form: counter % 3 = 0
  • With few exceptions, there is a convention to use English words for methods and math symbols for operators. This is important to distinguish the different language forms.

So to achieve the form you favour, the advise is to use the math operators.

 

1 hour ago, thorfdbg said:

Actually, C is all over for expressions, and the only way how to create a statement is to append a semicolon to an expression.

I wish that were true. Control flow structures in C are not expressions, and that is the hardest thing for Meta to generate C.

 

1 hour ago, thorfdbg said:

What I find rather opaque is that apparently the "value" of the "modulo 3" expression is not taken as an argument of "unless" (as one would expect), but "survives" it and the following group as nothing else overrides it there. At least this is what I get from your explanation. The problem I have here is that, as far as "value flow" is concerned, the expression "modulo 3" is connected to a sort of "T-junction" whose one end goes into "unless" and whose other end goes to the return of the function. There is no syntactic sugar to indicate this flow, and that's confusing.

It would be opaque if it were true. There seems to be a pattern that your first instinct is right, but then you don't see how it works under the hood and you start making up constructs that are too complex and are not there. This can be solved by studying the REBOL documentation. The modulo expression is an argument to unless just as it is written, there is no "survival" of this expression, there is no "T-junction" and there is no syntactic sugar for things that aren't there.

 

The flow of values, expressions and control in Meta is very simple and straightforward, even simpler than in REBOL.

  • Every syntactic element is a thing! (value in REBOL).
  • Every thing! is either a literal value or a method.
  • Every potentially composite construct is an expression.
  • Every expression returns a value (thing!).
  • A method can take parameters, which are (sub-)expressions.
  • A method can implement a control structure on its sub-expressions.

Therefore, a method taking parameters can transform these into a different return value. unless takes a condition expression that it interprets as logic!, and a block of generic expressions of which it takes the last value. With those, it infers its return type. You can call it a junction, but every method does this, in a straightforward way.

 

1 hour ago, thorfdbg said:

The same goes for "any" - I'm even more confused now as apparently there are expressions within the "any" construct that do not have a value, even though the expression behind "unless" has one. Thus, in which case an expression after unless is forwarded as output or not is again quite opaque to me.

There is nothing different about any. It takes one argument: usually a literal block! of sub-expressions. In FizzBuzz, it happens that the last expression of the code blocks of both unless and any return nothing!. For unless, it means it has to construct a logic! return value out of that. any is used as a statement here, so it doesn't have to return a value, so that automatically becomes nothing! and it doesn't matter.

 

This is all inspired by and similar to Lisp, accept that this Logo family of languages supports infix operators, to allow code closer to human language, as you also requested in your example.

Link to comment
Share on other sites

43 minutes ago, TGB1718 said:

I can usually look at other languages and at least get an idea of what's going on, but not this one (maybe I'm getting old :) )

This is exactly the problem. If you are not familiar with any language from the Logo family, you can not expect it to work to project pre-conceptions from other language families onto it.

 

44 minutes ago, TGB1718 said:

Maybe advertising this was a bit premature.

That has nothing to do with this issue. It doesn't matter if you don't read documentation now, or not last year, or not next year. It's not going to work for you, no matter what state the language is in. If anything, if it takes years to get people to read documentation, it was right to start that early.

Link to comment
Share on other sites

List-XEX works on Atari 8-bit and on modern PC platforms: Windows, Apple MacOS, Linux, FreeBSD, NetBSD and OpenBSD, using the exact same program source code. It even uses the same binary executable file on all modern systems. Here it shows its built-in help on Linux:

list-XEX-help-Linux-80-columns.thumb.png.36607978881e26e66b5e64ce7d67999e.png

 

It automatically adapts to the larger screen and makes use of an 80-column display instead of 40. This is not only useful on PC platforms, but also if you have some kind of 80-column display on your Atari.

Link to comment
Share on other sites

This language is fine, if you are interested in that kind of thing. It's a language essentially about languages (thus the 'meta') and as far as I can tell is focused on extreme flexibility of syntax and what some people think are 'natural' language constructs. I kind of think it's interesting, but I would rather be eaten by weasels than have to write an Atari game in it. It is manifestly not 'clear'. You saying 'well, you have to go learn it before you can see how clear it is' is a self-negating statement.

 

Kai, I don't know why you chose/included legacy 8-bit computing platforms for this experiment...I can't think of a more inappropriate platform to do something like this. No one here cares at all about running on large numbers of 'platforms', niceties of syntax, ease of expression, abstract clarity, or creating sub-idioms with flexibility. They care about program size, hardware control, and speed. Non-clarity is actually a plus, because it means something really tricky is going on. Most of us are assembly coders for heaven's sake. We spend hours staring into the the navel of a 6502 chanting opcodes just to save a few bytes. 

 

Let's all just stop arguing about it. Kai is doing his thing, if you don't like it just don't respond. Kai - good luck.

  • Like 1
Link to comment
Share on other sites

Meta has all of that, as I have shown here many times. If you don't care about half of it, you can use the other half - as happens in many languages. Meta has control over program size, hardware control, speed and an integrated assembler. If you think 29 bytes for a graphics demo is Iarge, I would like to see you beat it.

 

I still think it's very presumptuous of you to pretend to speak for everyone here. Let people speak for themselves, and they express it in their interest in the Meta threads here.

 

I guess you're the kind of person who goes to China and then complains in English to the people there that their language is unclear because it isn't obvious to you.

 

I do agree that people who are not interested in using Meta, keep refusing to make an effort, and keep ignoring my explanations and advice, have no business responding here.

  • Haha 1
Link to comment
Share on other sites

Look closer. The leading information uses fewer lines.

 

In a future version, I will put more info on a line, but this is the version that was frozen at the ABBUC's deadline.

 

The previous screenshots of the built-in help have completely different layout and different text between 40 and 80 columns.

Link to comment
Share on other sites

I don't know what you mean. Again, the layout is optimised and the text of the built-in help is optimised.

 

If you mean it doesn't have to be, then yes, it doesn't have to have this feature, but it does have this feature. In the case of the file name, it gets its own line on 40 columns to allow for longer file names, for example including directory paths, or FujiNet network paths.

Link to comment
Share on other sites

It's just that this program doesn't need more than 40 columns to display all the information. The names and paths to the file do not need to be displayed, because they are given as a parameter for calling the program anyway. Under other platforms, you can optionally add colorization, but this will probably not be available on Atari.

Link to comment
Share on other sites

It can be hard to grasp other people's motivations, but when I had an XEP80 on my Atari, it was because I wanted to see more content on the screen.

 

For example, if you use List-XEX on a file produced by Mac/65, you would get lots of 256-byte segments. It's very useful if they don't scroll off the screen.

 

List-XEX is a portable text-mode program, mainly for command-line environments. Colouring text mode is hard on Atari, so this is far outside the scope of List-XEX.

 

Showing the file name is just a feedback to the user how his or her command-line parameters are interpreted. Especially because they can also be interpreted as commands.

Link to comment
Share on other sites

7 minutes ago, Kaj de Vos said:

For example, if you use List-XEX on a file produced by Mac/65, you would get lots of 256-byte segments. It's very useful if they don't scroll off the screen.

I wrote something similar in cc65 (was also a disassembler), as I knew about MAC/65's tendency to make each block

around 256 bytes, I added the option to output to file/screen or printer because of the scrolling

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...