From 80195e4e06574f65d54642d15a3e49ff6094930b Mon Sep 17 00:00:00 2001 From: Torsten Date: Fri, 19 Nov 2021 20:36:02 +0200 Subject: [PATCH] A recapping post --- README.md | 6 +- .../posts/2021/_11-18-lessons-learned.haml | 118 ++++++++++++++++++ 2 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 app/views/posts/2021/_11-18-lessons-learned.haml diff --git a/README.md b/README.md index be75fd9..70893e9 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # [RubyX webpages](http://ruby-x.org) -RubyX's webpage are a rails 5.2 application run at Hetzner. +RubyX's webpage is a rails 5.2 application run at Heroku [http://ruby-x.org](http://ruby-x.org). If you don't know rails, most of the docs are quite close to text (called haml), found in the app/views/pages directory. -###Contribute +### Contribute We are _very_ open to improvement so if you see anything that is wrong or misleading, please create an issue. @@ -14,7 +14,7 @@ Also if you feel there is information missing, don't hesitate to mention it. Even better, clone and send a pull request. Typos and small things don't even need a branch. -###Local viewing +### Local viewing After having cloned the repository go to the folder and diff --git a/app/views/posts/2021/_11-18-lessons-learned.haml b/app/views/posts/2021/_11-18-lessons-learned.haml new file mode 100644 index 0000000..9ab4ceb --- /dev/null +++ b/app/views/posts/2021/_11-18-lessons-learned.haml @@ -0,0 +1,118 @@ +%p + Sooooo, we bought an old + =ext_link "hospital." , "https://www.hubfeenix.fi/" + Word of advice: don't buy an old hospital if + you can avoid it (obviously we tried and failed). It is understandably taking all + our energy to get the old into the shape of the new (ie a non-profit art center). + +%h2 Gather round kids, grandpa's talking +%p + So i am in a pensive mood, definitely reviewing. Maybe it's even the end? + +%h3 Constant Types +%p + The one thing to come out of this effort is the importance of constant types. +%p + The relation of fourth to third level languages has eluded me for many years, + at least in the very succinct form i can express it now. Vague notions that + fourth level languages need to be coded in third level languages (wrong!) or + need to be compiled down to third level like c++ was into c (wrong too) where + floating in my head. +%p + Quite early on i hit upon the importance of Types as a way to describe memory. + And the importance of those types being constant or immutable (obvious! but + then everything is in hindsight), because otherwise you wouldn't know here is + what. Third level languages have evolved the model of types naturally, as all + information is available / gathered before the program starts. +%p + A fourth level language has no types (in the sense above), it has classes. + Classes (or prototypes, 6 vs half dozen) can change over time. But if one + assigns a type to a class, the type instance changes when class attributes are + changed. +%p + This essential difference between changing classes and constant types is the + difference between fourth and third level language. + +%h3 The need for speed +%p + Speed was brushed aside for the longest time by dynamic language designers. + Luckily things are looking up, more on that below. Interpretation was + the easy way, quick to start but slow to get right. We are now at a point + where we have to retrofit speed, never an easy tasks. Whereas RubyX shows a + compiling approach would not have been difficult, not too difficult for people + in the 60's i mean. But as always, the problem was in the head. + +%p + Since C is pretty much as simple as can be, it will be difficult to beat in + terms of speed before a whole lot of work has enabled cross function + compilation and optimization, but i still think it is possible to make code + run faster than c, because of just that. Until then we (rather others), will + have to build just in time compilers for the instructions that VM's like YARV + use. +%p + This process, i am relieved to hear, has started. Not only with the slightly + hacky v8. But properly, by + = ext_link "Maxime." , "https://pointersgonewild.com/about/" + While working for Spotify, she has started a JIT project based on the idea + of collecting and using + = ext_link "immutable type data," , "https://pointersgonewild.com/2021/06/02/yjit-building-a-new-jit-compiler-inside-cruby/" + which she calls BBV. This is very similar to what i was doing for functions, + and she had the good sense to narrow the approach down to Basic Blocks (the BB + in BBV). The V is for versioning and means producing new types and not changing + old, ie having immutable types. + +%h2 Too late or too early +%p + Maxime says the Self people were onto this same idea too, but even from just + her phd i feel quite vindicated. While in so many ways i think that this work + has been started way to late, the choices i made (coding in ruby..) probably mean + %em my + work is actually ahead of it's time ie too early. But off course hopelessly + incomplete. +%p + Maxime says in one video that they will probably have to reimplement + parts of ruby in ruby, just so that their jit can perform cross function + compilations. Because they too have noticed very early on that with ruby's + small functions, cross function optimisation is going to be essential (more + vindication). +%p + Imho no decision is the best decision, and since i don't have time to do any + work on ruby-x, i won't :-) Having learned about Maxime and her teams effort, + seriously funded, well accepted, i will sit back and watch the show. + And assume (like in a Disney movie) that the happy end is on it's way. + +%h2 The icing: Quajects unravelled +%p + Just because i got some 404's from the + =link_to "synthesis thesis" , "/synthesis/index" + (which i consequently cleaned up and linked in), i touched on the + = link_to "Quajects" , "/synthesis/ch4.html" + again and finally + %em got it. + +%p + Quajects are "true" objects in the sense that they combine code and data in + their memory representation. "Normal" objects, implemented by any oo language, + are really only data. Their code is pointed to, not really part of the object, + more of the class. Off course you could argue that a class is an object, but + while that is true, it does not argue the point. As the code for the class is + again in it's class, and not in the object. +%p + Another way to look at Quajects is that they are a partial evaluation of an + original function (that is not present in synthesis). Ie if a normal OS gives + you a file descriptor and a read method that you then pass the descriptor to, + Synthesis gives you a quaject that reads only that one particular file. + Thus partially evaluating a general + read with respect to the given file descriptor. +%p + But while i say "true" object, there is the control flow aspect of Quajects + that has not made it into any higher level programming language. The closest + we got was the goto (shudder), but the quaject way is more like setjump (more + shudders, as both are not named/abstracted). I had a rambling + about that some while back, basically saying that we would have to model not + just functions (that always return to the same point), but also callouts (ie calling + code that is not intended to come back) and callins (places where other code + can land without expecting to be returned to). This is pie in the sky off course, + but it is where + = ext_link "Alexia Massalin" , "https://en.wikipedia.org/wiki/Alexia_Massalin" + was at, already in the 80's. Hat off.