Readit News logoReadit News
stevedekorte commented on Jsonrepair: Repair Invalid JSON Documents   github.com/josdejong/json... · Posted by u/vismit2000
stevedekorte · 3 months ago
I've found this handy for repairing AI generated JSON.
stevedekorte commented on Formatting code should be unnecessary   maxleiter.com/blog/format... · Posted by u/MaxLeiter
stevedekorte · 5 months ago
Io (http://iolanguage.org) can work this way, as the message tree (maybe including comments - I don't recall) is what the interpreter used to evaluate the code and is accessible at runtime. However, it didn't store the choice of terminator (newline vs return) or indentation info (though it would be easy to add), so the pretty print of the message tree might look different depending on the source conventions.
stevedekorte commented on Nobody cares   grantslatton.com/nobody-c... · Posted by u/fzliu
gizmo · a year ago
Of course there are "reasonable justifications" for the shitty status quo, but that's kind of the point. Things are shitty for reasons but not for good reasons. The author points to Japan to illustrate that you do get measurably better results when people habitually try to do good work. We're not actually doomed to have crappy furniture, flimsy and buggy appliances, byzantine legal codes, ugly architecture, and hostile infrastructure forever. This society is the product of the choices we've made collectively and if we made different choices we could have a much better (or much worse) society.
stevedekorte · a year ago
But street lights don't have to use harsh 3000 kelvin LEDs, there are warm light LEDs (2400-2700 kelvin). For example, these lights are widely available for home, yet most people just buy the 3000K LED bulbs because (IME) it doesn't occur to them that there is a strong aesthetic (and health) difference between these colors. i.e. They don't care.
stevedekorte commented on Show HN: Lfi – a lazy functional sync, async, and concurrent iteration library   lfi.dev/... · Posted by u/tomeraberbach
stevedekorte · a year ago
Looks useful and powerful. Nice work!
stevedekorte commented on I can now run a GPT-4 class model on my laptop   simonwillison.net/2024/De... · Posted by u/simonw
stevedekorte · a year ago
It’s great that this can run on a laptop but FWIW, llama 70B model is no where near “GPT-4 class” in my own use cases. 405B might be, though I haven’t tested it.
stevedekorte commented on Oasis: A Universe in a Transformer   oasis-model.github.io/... · Posted by u/gadtfly
stevedekorte · a year ago
How are state changes consistently tracked?
stevedekorte commented on What should a logo for NeXT look like? (1986)   paulrand.design/work/NeXT... · Posted by u/themantra514
threeio · a year ago
Literally got my Next Slab working over the weekend, seen presentation before and its put a good smile on my face today.
stevedekorte · a year ago
Congrats! I have strong nostalgia for the ones I worked on and owned in the 90s. Using those machines felt more like living in the future than any tech I've experienced since, including the iPhone.
stevedekorte commented on Dynamic translation of Smalltalk to WebAssembly   thiscontext.com/2023/07/2... · Posted by u/lioeters
DonHopkins · 2 years ago
Craig Latta's Caffeine work live coding with Smalltalk and SqueakJS is amazing.

https://observablehq.com/@ccrraaiigg/caffeine

>Caffeine integrates SqueakJS, a JavaScript implementation of the Squeak Smalltalk virtual machine, with several JavaScript runtime environments, including web frontends (web browsers, with DOM, DevTools, and Observable integration), backends (Node]S), and Web Workers.

https://github.com/ccrraaiigg

Craig Latta - Caffeine - 26 May 2021:

https://vimeo.com/591827638

>Caffeine ( caffeine.js.org ) is a livecoded integration of the SqueakJS Smalltalk virtual machine with the Web platform and its many frameworks. Craig Latta will show the current state of Caffeine development through live manipulation and combination of those frameworks. The primary vehicle is a Caffeine app called Worldly, combining the A-Frame VR framework, screen-sharing, and the Chrome Debugging Protocol into an immersive virtual-reality workspace.

>Craig Latta ( blackpagedigital.com ) is a livecoding composer from California. He studied music at Berkeley, where he learned Smalltalk as an improvisation practice. He has worked as a research computer scientist at Atari Games, IBM's Watson lab, and Lam Research. In 2016 he began combining Smalltalk technologies with the Web platform, with an emphasis on spatial computing. He is currently exploring spatial audio for immersive workspaces.

SqueakJS – A Squeak VM in JavaScript (squeak.js.org) 115 points by gjvc on Oct 27, 2021 | hide | past | favorite | 24 comments

https://news.ycombinator.com/item?id=29018465

DonHopkins on Oct 27, 2021 | prev | next [–]

One thing that's amazing about SqueakJS (and one reason this VM inside another VM runs so fast) is the way Vanessa Freudenberg elegantly and efficiently created a hybrid Smalltalk garbage collector that works with the JavaScript garbage collector.

SqueakJS: A Modern and Practical Smalltalk That Runs in Any Browser

https://freudenbergs.de/vanessa/publications/Freudenberg-201...

>The fact that SqueakJS represents Squeak objects as plain JavaScript objects and integrates with the JavaScript garbage collection (GC) allows existing JavaScript code to interact with Squeak objects. This has proven useful during development as we could re-use existing JavaScript tools to inspect and manipulate Squeak objects as they appear in the VM. This means that SqueakJS is not only a “Squeak in the browser”, but also that it provides practical support for using Smalltalk in a JavaScript environment.

>[...] a hybrid garbage collection scheme to allow Squeak object enumeration without a dedicated object table, while delegating as much work as possible to the JavaScript GC, [...]

>2.3 Cleaning up Garbage

>Many core functions in Squeak depend on the ability to enumerate objects of a specific class using the firstInstance and nextInstance primitive methods. In Squeak, this is easily implemented since all objects are contiguous in memory, so one can simply scan from the beginning and return the next available instance. This is not possible in a hosted implementation where the host does not provide enumeration, as is the case for Java and JavaScript. Potato used a weak-key object table to keep track of objects to enumerate them. Other implementations, like the R/SqueakVM, use the host garbage collector to trigger a full GC and yield all objects of a certain type. These are then temporarily kept in a list for enumeration. In JavaScript, neither weak references, nor access to the GC is generally available, so neither option was possible for SqueakJS. Instead, we designed a hybrid GC scheme that provides enumeration while not requiring weak pointer support, and still retaining the benefit of the native host GC.

>SqueakJS manages objects in an old and new space, akin to a semi-space GC. When an image is loaded, all objects are created in the old space. Because an image is just a snapshot of the object memory when it was saved, all objects are consecutive in the image. When we convert them into JavaScript objects, we create a linked list of all objects. This means, that as long as an object is in the SqueakJS old-space, it cannot be garbage collected by the JavaScript VM. New objects are created in a virtual new space. However, this space does not really exist for the SqueakJS VM, because it simply consists of Squeak objects that are not part of the old-space linked list. New objects that are dereferenced are simply collected by the JavaScript GC.

>When full GC is triggered in SqueakJS (for example because the nextInstance primitive has been called on an object that does not have a next link) a two-phase collection is started. In the first pass, any new objects that are referenced from surviving objects are added to the end of the linked list, and thus become part of the old space. In a second pass, any objects that are already in the linked list, but were not referenced from surviving objects are removed from the list, and thus become eligible for ordinary JavaScript GC. Note also, that we append objects to the old list in the order of their creation, simply by ordering them by their object identifiers (IDs). In Squeak, these are the memory offsets of the object. To be able to save images that can again be opened with the standard Squeak VM, we generate object IDs that correspond to the offset the object would have in an image. This way, we can serialize our old object space and thus save binary compatible Squeak images from SqueakJS.

>To implement Squeak’s weak references, a similar scheme can be employed: any weak container is simply added to a special list of root objects that do not let their references survive. If, during a full GC, a Squeak object is found to be only referenced from one of those weak roots, that reference is removed, and the Squeak object is again garbage collected by the JavaScript GC.

DonHopkins on Oct 27, 2021 | parent | next [–]

Also: The Evolution of Smalltalk: From Smalltalk-72 through Squeak. DANIEL INGALLS, Independent Consultant, USA

https://smalltalkzoo.thechm.org/papers/EvolutionOfSmalltalk....

>A.5 Squeak

>Although Squeak is still available for most computers, SqueakJS has become the easiest way to run Squeak for most users. It runs in just about any web browser, which helps in schools that do not allow the installation of non-standard software.

>The germ of the SqueakJS project began not long after I was hired at Sun Microsystems. I felt I should learn Java; casting about for a suitable project, I naturally chose to implement a Squeak VM. This I did; the result still appears to run at http://weather-dimensions.com/Dan/SqueakOnJava.jar .

>This VM is known in the Squeak community as "Potato" because of some difficulty clearing names with the trademark people at Sun. Much later, when I got the Smalltalk-72 interpreter running in JavaScript, Bert and I were both surprised at how fast it ran. Bert said, "Hmm, I wonder if it’s time to consider trying to run Squeak in JavaScript." I responded with "Hey, JavaScript is pretty similar to Java; you could just start with my Potato code and have something running in no time."

>"No time" turned into a bit more than a week, but the result was enough to get Bert excited. The main weakness in Potato had been the memory model, and Bert came up with a beautiful scheme to leverage the native JavaScript storage management while providing the kind of control that was needed in the Squeak VM. Anyone interested in hosting a managed-memory language system in JavaScript should read his paper on SqueakJS, presented at the Dynamic Languages Symposium [Freudenberg et al. 2014].

>From there on Bert has continued to put more attention on performance and reliability, and SqueakJS now boasts the ability to run every Squeak image since the first release in 1996. To run the system live, visit this url: https://smalltalkzoo.thechm.org/HOPL-Squeak.html?launch

codefrau on Nov 5, 2021 | root | parent | next [–]

Dan published an updated version of that paper here:

https://smalltalkzoo.thechm.org/papers/EvolutionOfSmalltalk....

Would be great if you could cite that one next time. The main improvement for me is not being deadnamed. There are other corrections as well.

stevedekorte · 2 years ago
"In JavaScript, neither weak references... is generally available". I think that was true with the old weak collation classes, but doesn't the newer JS WeakRef provide proper weak references?
stevedekorte commented on Dynamic translation of Smalltalk to WebAssembly   thiscontext.com/2023/07/2... · Posted by u/lioeters
stevedekorte · 2 years ago
Great to see work like this being done. Javascript is often a "good enough" language, but an efficient Smalltalk (or Self) language with support for things like system images, become:, coroutines, and other advanced features would open up a lot of advanced programming techniques like fast portable images, transparent futures, cooperative concurrency without async/await on every call, etc.
stevedekorte commented on The Cell Programming Language   cell-lang.net/... · Posted by u/manx
stevedekorte · 2 years ago
At first, I though this was a link to another cool language with a very similar name: http://www.redwoodsoft.com/~dru/cel/

u/stevedekorte

KarmaCake day414September 11, 2007
About
@stevedekorte
View Original