Jump to content

Recommended Posts

14 hours ago, zbyti said:

Interesting:


count: 10

repeat count [write/line count: 10 - count]

write/line "end"

atari000.png.c59066880c8eb527c239060f49817ecd.png

In REBOL: 

REBOL []

count: 10

loop count [print count: 10 - count]

print "end"

it gives the same result:

0
10
0
10
0
10
0
10
0
10
end

This is also a good example why we do need documentation (or at least description of differences from REBOL) for writing even basic code:

  • In META repeat has different use/meaning than in REBOL
  • In META write has different use/meaning than in REBOL 
Edited by ilmenit
Link to comment
Share on other sites

13 hours ago, zbyti said:

the first produces 0 and 1000 alternately (which I don't understand), and the second of course 0.

in Meta repeat behaves like loop in Rebol, and the parameter count ONLY tells how many times the following block will be evaluated, where the count parameter seems to be evaluated only once, not after each loop iteration.

Take a look at the differences between loop, repeat and for in Loop functions sections of https://www.cis.upenn.edu/~matuszek/Concise Guides/Concise Rebol.html 

I do not know the reason why loop exists in this language as a dedicated keyword (sorry, Rebol has no keywords, it's a "control function" ;-)). 

Link to comment
Share on other sites

25 minutes ago, zbyti said:

I still don't get it :( 

 

10 - 10 = 0 // OK

 

0 - 10 = 10 // it's new to me

 

In 8-bit world a expect rather 246.

This is not how it works.

10-10 is 0

there is no 0-10 in your example, there is always count = 10-count, so it's either 10-0 or 10-10, depending if count is 0 or 10.

 

Here is the equivalent in C

/*
count: 10
repeat count [write/line count: 10 - count]
write/line "end"
*/

#include <stdio.h>

int main()
{
    int count = 10;

    // loop count [] will only tell how many times execute the block
    int times = count; // evaluated only once
    for (int loop = 0; loop < times; ++loop)
    {
        count = 10 - count;
        printf("%d\n", count);
    }
    printf("end");
}

that gives:

0
10
0
10
0
10
0
10
0
10
end

 

Edited by ilmenit
  • Thanks 2
Link to comment
Share on other sites

7 hours ago, ilmenit said:

curl: (60) SSL certificate problem: unable to get local issuer certificate

 

7 hours ago, ilmenit said:

I tried to use the compile.ape with curl.exe to compile a sample program, however with "Result is in file program.xex" there is no program.xex in the current directory. Any hints?

 

https://language.metaproject.frl/#Windows

Edited by Kaj de Vos
Fixed link
  • Thanks 1
Link to comment
Share on other sites

29 minutes ago, Kaj de Vos said:

Thanks for trying Meta! It's really cool to see someone else using my language, especially on Atari.

A very basic feature we are waiting for is ability to set some (preferably defined) memory array on an aligned memory location, and getting a 16bit pointer to it, so we can create a display list, screen memory and show some PMG ?

Edited by ilmenit
Link to comment
Share on other sites

18 minutes ago, Kaj de Vos said:

Again, no pointers, but you can always get around it with little snippets of integrated assembly, so no need to wait.

Could you give an example how to do it? In the most basic case we need to:

1. Reserve some aligned (to $800) memory location for PMG, but making sure that it won't be overwritten by the program code and data. From DeRe "The pointer to the beginning of the player-missile area is labelled PMBASE. Because of internal limitations of ANTIC, PMBASE must be on a 2K address boundary for single-line resolution, or a 1K address boundary for double-line resolution.". 

2. Set the PMBASE ($D407) to this aligned memory location (PMBASE= ~D407, from rainbow example, but still we need address of this reserved memory)

3. If possible, having this memory predefined with data, without need to copy of data to this location (something like binary inclusion or Bin2C approach to transform binary to the language array).

Edited by ilmenit
Link to comment
Share on other sites

8 minutes ago, Kaj de Vos said:

What you call basic and simple is actually a complex challenge. Examples will come in due time.

Sure, I understand. By basic I mean here the basic use cases for 8bit Atari programming:

- using PMG

- using Display lists and Screen memory

- using custom fonts for text-modes

- having an excluded window in the middle of Atari memory ($4000-$8000) for banked memory

Without having it covered it's hard to come up with other program than one that is printing some text and values in the default text screen.

Edited by ilmenit
Link to comment
Share on other sites

Yes and no. I know all those use cases and have wanted for decades to make nice REBOL abstractions for them, even though they are very low-level. As Carl Sassenrath says, it is very hard to make things simple. Those abstractions simplify things and make them much more readable, but they take a lot of time to design and create.

 

That's why I also wanted the PL65 way of enabling everything right away through integrated assembly. You can do anything you want, but the nicer abstractions will come slowly over time.

Link to comment
Share on other sites

12 minutes ago, Kaj de Vos said:

That's why I also wanted the PL65 way of enabling everything right away through integrated assembly. You can do anything you want, but the nicer abstractions will come slowly over time.

This is a good idea. Still integrated assembly may not solve all the issues that e.g. linker in C language is resolving (placement of symbolic addresses as numeric addresses in the memory). Also if Meta is going to address different platforms (even for 6502) then they may have different loaders (e.g. on Atari it's common that programs are split into multiple segments, on C64 programs have only one segment, and when compiled as cart images the output is made of cartridge memory banks).

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