Jump to content

Recommended Posts

On 11/19/2021 at 8:44 PM, ilmenit said:

I'm also curious how indexing of bytes on specific memory page will work, when with 8bit byte you can index values 0-255, not 1-256. Will it require using 16bit variable?

You can index 1-255 within a byte! fine.

For 257... you need a natural! index anyway.

That only leaves the case of a series! of exactly 256 items. You can index it with a 16-bit natural!, or if you want to optimise the index to a byte!, you can shift the series! to 0-based indexing.

 

Unlike REBOL, I defined

pick series 0

to mean the same as

pick series -1

That means you can do 0-based indexing on

next series

Simple as that.

Link to comment
Share on other sites

On 11/20/2021 at 1:23 PM, zbyti said:

I also thought about it when I was filling arrays/memory with values in starfield example.

You're drawing 255 scanlines, so your index fits in a byte!. You don't have to declare it as a byte! explicitly, it will be inferred as that.

 

I suspect you have to limit it to 254 scanlines for NTSC compatibility, anyway. It's not a problem for this use case.

Link to comment
Share on other sites

2 hours ago, Kaj de Vos said:

You're drawing 255 scanlines, so your index fits in a byte!. You don't have to declare it as a byte! explicitly, it will be inferred as that.

 

I suspect you have to limit it to 254 scanlines for NTSC compatibility, anyway. It's not a problem for this use case.

I did it for reason which I don't remember exactly now, but then this was looks necessary to declare it as a byte!

Link to comment
Share on other sites

22 hours ago, drac030 said:

By this definition ("learn it") pretty much everything is "human-readable", even Egyptian hieroglyphs.

Not really, because that took the chance discovery of the Rosetta stone. But I understand what you mean.

 

In any case, there is a large range between those. I put it that way, because @TGB1718 keeps insisting that he hasn't seen anything human-readable yet. He is from the UK, and the base example for Meta is

Write "Hello, world!"

Am I to understand that he can't read that?

 

Then when will he be able to read that? When a dot is added at the end, as in COBOL?

 

If he can't read simple examples, he will certainly consider larger examples unreadable, too.

 

Many people, upon first seeing REBOL code, remark that it looks like human language. Yet some people keep insisting that it is unreadable. Could it be that REBOL and Meta are shapeshifters and manifest completely differently to different people? Or could the difference be in those people? Should I advise them to use COBOL instead? Or could it be that some people are whining because they are afraid to try something new, and they need to be pushed a bit to get over themselves?

Link to comment
Share on other sites

1 minute ago, Kaj de Vos said:

Am I to understand that he can't read that?

don't be insulting, that is a simple example and it's pretty obvious what it does, I was talking about

the larger examples and those that others have produced which in my opinion are not readable by any

stretch of the imagination especially without some form of documentation to give us a clue what's happening.

 

5 minutes ago, Kaj de Vos said:

Or could it be that some people are whining because they are afraid to try something new, and they need to be pushed a bit to get over themselves?

You are the one who said "human readable" and didn't release any documentation, I try new things all the time, but usually there's a few clues

on how to get started and it's not whining to ask for this information

Link to comment
Share on other sites

I am asking, because you keep exaggerating that you haven't seen anything human-readable yet, so I have no idea where it is that you get stuck. You also keep repeating that there is no documentation, which is also an exaggeration, so I can only keep repeating that I wrote an extensive website as documentation, extensive information here on the forum, and that I curated a reading list of basic REBOl documentation that is mostly usable for Meta, until I have time to write Meta-specific versions.

 

So now that we have established that you are past the Hello World example, where do you get stuck?

Link to comment
Share on other sites

1 hour ago, Kaj de Vos said:

Not really, because that took the chance discovery of the Rosetta stone.

Rosetta stone is not very relevant here, because now we are living in the times after the Rosetta stone (so one can learn hieroglyphs from a textbook), and also there were times when the knowledge of the hieroglyphs had not been lost, and you were able to learn them from a teacher. So for the sake of a better analogy, we can say that it is Greek instead of hieroglyphs (because the knowledge of Greek has never been lost).

 

The point, at least as I understand it, may be somewhere else. You are claiming that Meta has "Human-friendly syntax" and is "Closer to human language than most computer languages". Perhaps it is so. But for the untrained eye, the examples available in this thread contain much too many usual code symbols (=, [], ~ etc.) to be recognized as a human language: perhaps it is "closer", but still not does not look like close enough.

 

For example:

 

unsafe!!! constant reference volatile byte! [
  RTCLOK=  ~14
]

 

In human language it would be rather something along the lines of label volatile byte number 20 as "RTCLOK".

 

Edited by drac030
Link to comment
Share on other sites

As you say, I claim Meta is closer to human language than most computer languages, not that it is the same as human language. So everything is relative, and that opens up space to disagree. You can disagree with specific examples, but I don't think it's fair to deny in general that Meta is closer to human language than most computer languages.

 

In fact, that is exactly where the pushback here keeps coming from: that Meta is different from most computer languages. Except Logo, which people should actually be familiar with from Atari history.

 

The thing about the Atari-specific examples is that I had to extend the REBOL design to support hardware programming, and to support being much more efficient. So the Atari examples also look alien to REBOL programmers. They, too, need to learn these new extensions, and non-Logo programmers need to learn the entire language.

 

Specifically the declaration dialect you mention is a new dialect that is not in REBOL. Semantically, it is more like C, because it needs those features. One thing about it is that it will in time disappear from most examples, once we have the Atari system predefined. In general, Meta will keep adding abstractions over time to make things easier.

 

Having to learn new dialects works the same way in human language. Who wants to become a doctor, for example, needs to do a long and hard study, where one thing they learn is dialects to speak in with other doctors, even different ones for different specialisations. That's why I keep stipulating that Meta and dialects are not for free: they need to be learned before you get the benefits. I do think REBOL historically made a mistake there by presenting one-liner examples and claiming that all sorts of things would be easy.

Link to comment
Share on other sites

On 11/15/2021 at 9:23 PM, zbyti said:

unsafe!!! constant reference volatile byte! [
  RND= ~D20A
]

forever [
  either RND < ~80 [write "/"] [write "\\"]
]

write "workaround"

atari000.png.e1fac99c7cfe0a64f5e0cbec6ce48299.png

program.xex 3.91 kB · 4 downloads

 

without last line I have an error:

 


out.c:26: Error: Expression expected
out.c:26: Error: Illegal function call
out.c:31: Error: Incomplete type 'void'
out.c:31: Error: Incomplete type 'void'
out.c:32: Warning: Parameter 'arguments' is never used
4 errors and 1 warnings generated.

 

Fixed now. The output size is also reduced.

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

I have read this to grasp idea of Rebol power ;) 

 

Last time I had contact with Scala was 4-5 years ago but I can still read it easily:

(1 until 100).map(i => (i % 3, i % 5) match {
  case (0, 0) => "FizzBuzz"
  case (0, _) => "Fizz"
  case (_, 0) => "Buzz"
  case _ => i
}).foreach(println)

and it seems very elegant to me.

 

How elegant can that be in META?

Edited by zbyti
mixed link
Link to comment
Share on other sites

I love pattern matching in Scala but must admit you are much better then "Fork" and "Janko" :]

 

--- EDIT ---

 

here, for your website:

 

https://github.com/KarolS/millfork/blob/master/examples/crossplatform/fizzbuzz.mfk

https://github.com/KarolS/millfork/blob/master/examples/crossplatform/fizzbuzz2.mfk

https://github.com/KarolS/millfork/blob/master/examples/crossplatform/fizzbuzz_jp.mfk

Edited by zbyti
  • Thanks 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...