Jump to content

Recommended Posts

54 minutes ago, Kaj de Vos said:

I plan to reserve that for paying customers. It was hard to implement, so I consider it a trade secret until the project is firmly established.

Bold plan for a language, especially if there is not big corporation behind it. Wasn't commercial approach one of the reasons why Rebol failed?

57 minutes ago, Kaj de Vos said:

Found the source of what's in my head:

http://www.paulgraham.com/power.html

There is truth in the article but also as it says, there is no evidence. There is also a question what "productivity" is. I love Python for how quickly you can code something, how duck typing simplifies things, how dynamic nature allows to extend anything at runtime. What a productivity! Good bye C++ and C#!

And then I worked on a big project of data processing pipeline, where sure - the code was created fast, but runtime errors, lack of encapsulation, lack of safety features, need to write unit testing, lack of "boilerplate safety code" and everything that static compiler could prevent totally killed the productivity. 

My opinion is that the syntax of the language matters very little for productivity. What matters is how available are libraries not to reinvent the wheel (esp. for basic data structures and algorithms but also specific uses like authentication), how good are tools for writing or refactoring the code, how safe is the language, how can you prevent bugs before execution, how easily you can debug the code, what is the performance of the language, how well it supports parallel processing etc.

 

For example in Rebol documentation there is "proud" example:

Sell 100 shares of "Acme" at $47.97 per share

and now lets compare it with "generic modern language":

Stocks.SellShares(100,"Acme",47.97);

How making a dialect is better than using a language with set syntax and doing a library instead of a dialect? Is this really more productive?

Ok, not going to continue, otherwise we will get another rant here ;-)

Edited by ilmenit
Link to comment
Share on other sites

1 minute ago, ilmenit said:

Bold plan for a language, especially if there is not big corporation behind it. Wasn't commercial approach one of the reasons why Rebol failed?

No, it went great in its commercial phase, then it was torn apart when it was released as open source and the author was mismanaging it.

 

Don't you think it would be bolder to work double fulltime for decades without an income?

 

3 minutes ago, ilmenit said:

There is truth in the article but also as it says, there is no evidence.

It doesn't say that, it lists a number of sources of evidence.

 

6 minutes ago, ilmenit said:

everything that static compiler could prevent totally killed the productivity.

Fortunately, you get a static compiler with Meta.

 

7 minutes ago, ilmenit said:

What matters is how available are libraries not to reinvent the wheel

From the perspective of REBOL programmers, that's contradictory. There is so much tight functionality in the language, that you don't need libraries to reinvent the wheel.

 

9 minutes ago, ilmenit said:

How making a dialect is better than using a language with set syntax and doing a library instead of a dialect? Is this really more productive?

Often it is. As Graham argues, single line examples are not suitable to judge this.

 

10 minutes ago, ilmenit said:

Ok, not going to continue, otherwise we will get another rant here ;-)

Too late...

Link to comment
Share on other sites

7 minutes ago, Kaj de Vos said:

From the perspective of REBOL programmers, that's contradictory. There is so much tight functionality in the language, that you don't need libraries to reinvent the wheel.

There is a lot (built-in datatypes), but for very specific use-cases. I do not see functionality e.g. for deep learning, for big numbers, for 2D pathfinding, for graphs, for calculation of field of view, authenticatin, encryption, 3D physics, distributed computing, GPU programming, text-to-speech, state machines and whatever else needed at time. For sure it's possible to write them in Rebol in less number of code lines than in other languages, though, so productivity is assured ;-) 

Link to comment
Share on other sites

Here is my Sieve benchmark for Meta. 10 iterations were executed in 832 ticks, which is not bad, placing it behind MadPascal or CC65 but before Action!

sieve.png.242022112999348a69ad4268bf43be9d.png

If I'm correct, in the recent version MadPascal got almost 2x better result.

@zbyti - do you have it in some table, maybe also for other languages?

@Kaj de Vos, if you see there any places to improve the code, would be great to get your hints here. I'm curious also about the more "Rebolish" version with iteration over series instead of Poke.

 

The code:

iter: 1
sizepl= 8192
size= 8190

unsafe!!! constant reference volatile byte! [
    ; OS
    RTCLOK2= ~13
    RTCLOK3= ~14
]

RTCLOK2: 0
RTCLOK3: 0

natural! [count i]

while iter <= 10 
[
    count: 0
    i: 0
    flags= make static binary! sizepl
    
    
    for i sizepl
    [
        poke flags i 1
    ]

    i: 0
    while i <= size
    [
        p: pick flags i
        if p = 1 
        [
            prime: ( i * 2 ) + 3
            k: prime + i 
            while k <= size
            [
                poke flags k 0
                k: k + prime
            ]
            count: count + 1
        ]
        i: i + 1
    ]
    iter: iter + 1
]

ticks: RTCLOK3 + ( RTCLOK2 * 256 )
write count write/line " primes" 
write ticks write/line " ticks" 


 

sieve.meta program.xex

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

Screenshot_2021-11-18_21-40-44.thumb.png.7f41177e13f2cddc1d6012bb250516fb.png

 

I have old results, they would need to be re-check again, especially Atari Basic has a trick of filling arrays (as far as I remember) which I didn't use.

 

I also wrote faster code in Action! with the use of ZP.

 

Obviously, current Mad Pascal has a better result than the CC65.

 

Screenshot_2021-11-18_21-49-52.png.dc5fd7d1b0c26ccc9f6e132441dc410a.png

 

OPT means in most cases ZP usage.

 

--- EDIT ---

 

and bench code uses fillbyte or memset if possible, again - as far as I remember :D 

Edited by zbyti
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

15 minutes ago, zbyti said:

and bench code uses fillbyte or memset if possible, again - as far as I remember :D 

even in Rebol not everything is written purely in Rebol e.g. take a look at http://www.rebol.com/docs/words/wtrim.html and https://github.com/rebol/rebol/blob/master/src/core/s-trim.c

so I think in Meta Kaj can also identify common patterns and replace e.g. for loop with memset. On the other hand, if llvm-mos will be used in the future then this compiler may do it automagically.

Link to comment
Share on other sites

size= 255

unsafe!!! constant reference volatile byte! [
  P0PF=    ~2C0
  HPOSM0=  ~D004
  GRAFM=   ~D011
  COLBK=   ~D01A
  RANDOM=  ~D20A
  WSYNC=   ~D40A
  VCOUNT=  ~D40B
]

byte! [i tmp]

GRAFM: P0PF: ~e

stars= make static binary! size
speed= make static binary! size

for i size [
  poke stars i RANDOM
  either RANDOM < ~80 [tmp: 1] [tmp: 2] ;how to use mask `and` ?
  poke speed i tmp
]

forever [
  if VCOUNT = 0 [
    for i size [
      WSYNC: HPOSM0: pick stars i
      poke stars i ((pick stars i) + (pick speed i))
    ]
  ]
]

atari000.png.036787e4335aafd83a1cc999eb8c65e5.png

program.xex

Edited by zbyti
  • Thanks 1
Link to comment
Share on other sites

@sanny

 

It was two years ago, I didn't know assembler yet.

 

The code was written by @tebe. I thought that due to the use of pseudo-instructions and macros, not every assembler will produce the same code in ML then is worthy mention it. I don't remember the code and I don't know if this is that case.

 

But in general you are right.

Edited by zbyti
Link to comment
Share on other sites

Are series operations available on static binary! ?

	flags= make static binary! sizepl

	; write/line first flags ; "first" has no value
	; write/line probe flags ; "probe" has no value

	
	; for-all flags ; "for-all" does not work on types combination 1: static-binary! [flags []
	[ 
;        flags/1: 1 ; unknown element: flags/1
    ]

is it possible with the current Meta version rewrite the example to use series instead of pick/poke?

Link to comment
Share on other sites

14 minutes ago, Kaj de Vos said:

Should just be


tmp: either RANDOM and 1 [1] [2]

 

** Script error: no known implicit method "and*" with 2 parameters.
At: [and 1 [1] [2]
    poke speed i tmp
]
In: [RANDOM and 1 [1] [2]
    poke speed i tmp
]
Near: [either RANDOM and 1 [1] [2]
    poke speed i tmp
]

`tmp: (RANDOM and 3) + 1` is enough for me but `and` is unknown.

Edited by zbyti
  • Thanks 1
Link to comment
Share on other sites

size= 255

unsafe!!! constant reference volatile byte! [
  P0PF=    ~2C0
  HPOSM0=  ~D004
  GRAFM=   ~D011
  COLBK=   ~D01A
  RANDOM=  ~D20A
  WSYNC=   ~D40A
  VCOUNT=  ~D40B
]

byte! [ i ]

GRAFM: P0PF: ~e

stars= make static binary! size
speed= make static binary! size

for i size [
  poke stars i RANDOM
  poke speed i ((RANDOM and 3) + 1)
]

forever [
  if VCOUNT = 0 [
    for i size [
      WSYNC: HPOSM0: pick stars i
      poke stars i ((pick stars i) + (pick speed i))
    ]
  ]
]

atari000.png.a5649b29ae513fc6b2cea1f9082d1b83.png

program.xex

 

  • Thanks 1
Link to comment
Share on other sites

15 minutes ago, Kaj de Vos said:

Thanks! Let me know if it's fixed now.

seems to be the same error. Also do you have other keyword for change?

    flags= make static binary! sizepl

    for-all flags ; "for-all" does not work on types combination   1: static-binary! [flags
    [ 
;        change flags 1 ; "change" has no value
    ]

 

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