zbyti Posted November 18, 2021 Share Posted November 18, 2021 38 minutes ago, ilmenit said: I didn't have opportunity in the past to play with Rebol and it taught me interesting piece of computer history. Rebol Yell 1 1 Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 18, 2021 Share Posted November 18, 2021 (edited) 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 November 18, 2021 by ilmenit Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 18, 2021 Author Share Posted November 18, 2021 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... Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 18, 2021 Share Posted November 18, 2021 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 Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 18, 2021 Author Share Posted November 18, 2021 Yes, if you write libraries for those in REBOL they will be much smaller and much less redundant. Especially as dialects. Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 18, 2021 Share Posted November 18, 2021 Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 18, 2021 Share Posted November 18, 2021 (edited) 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! 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 November 18, 2021 by ilmenit 1 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 18, 2021 Share Posted November 18, 2021 (edited) 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. OPT means in most cases ZP usage. --- EDIT --- and bench code uses fillbyte or memset if possible, again - as far as I remember Edited November 18, 2021 by zbyti 1 1 Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 18, 2021 Share Posted November 18, 2021 15 minutes ago, zbyti said: and bench code uses fillbyte or memset if possible, again - as far as I remember 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. Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 18, 2021 Share Posted November 18, 2021 5 minutes ago, ilmenit said: 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. KickC is good at it :] Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 18, 2021 Author Share Posted November 18, 2021 Great work! The REBOL interpreter, datatype actions and many native functions are written in C. Same in Red, but in Red/System. That's one thing that is radically different in Meta. More tomorrow. 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 18, 2021 Share Posted November 18, 2021 (edited) 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)) ] ] ] program.xex Edited November 19, 2021 by zbyti 1 Quote Link to comment Share on other sites More sharing options...
sanny Posted November 19, 2021 Share Posted November 19, 2021 @zbyti, in your table in post #258, isn't MADS an assembler? If yes, is there a reason you write "MADS" instead of "Assembler"? Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 19, 2021 Share Posted November 19, 2021 (edited) @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 November 19, 2021 by zbyti Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 19, 2021 Share Posted November 19, 2021 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? Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 19, 2021 Author Share Posted November 19, 2021 Path accessors aren't implemented yet. That's syntax sugar for later, when the basic methods work. first is first-of in Meta. Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 19, 2021 Author Share Posted November 19, 2021 11 hours ago, zbyti said: either RANDOM < ~80 [tmp: 1] [tmp: 2] ;how to use mask `and` ? Should just be tmp: either RANDOM and 1 [1] [2] 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 19, 2021 Share Posted November 19, 2021 (edited) 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 November 19, 2021 by zbyti 1 Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 19, 2021 Author Share Posted November 19, 2021 Thanks! and and or should be fixed now. Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 19, 2021 Author Share Posted November 19, 2021 1 hour ago, ilmenit said: "for-all" does not work on types combination 1: static-binary! Thanks! Let me know if it's fixed now. Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 19, 2021 Share Posted November 19, 2021 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)) ] ] ] program.xex 1 Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 19, 2021 Author Share Posted November 19, 2021 9 minutes ago, zbyti said: WSYNC: HPOSM0: pick stars i You probably want to do this the other way around: HPOSM0: WSYNC: pick stars i That writes WSYNC before HPOSM0. 1 Quote Link to comment Share on other sites More sharing options...
ilmenit Posted November 19, 2021 Share Posted November 19, 2021 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 ] Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 19, 2021 Author Share Posted November 19, 2021 poke Please try again. Quote Link to comment Share on other sites More sharing options...
Kaj de Vos Posted November 19, 2021 Author Share Posted November 19, 2021 Ah, you can't iterate a constant. You first need to assign flags to a variable reference. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.