News for hackers. Stuff that matters.
Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by narutowindy on Sunday January 01, 2023 @02:56PM (#34210162)
Someone explain what's smalltalk?
Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by johndoe0815 on Sunday January 01, 2023 @03:08PM (#34210295)
Smalltalk is a programming language (+runtime, GUI, development environment) that originated at the Xerox PARC research center in the early 1970s on the Alto computer. Smalltalk was one of the first object-oriented systems (along with the Norwegian Simula system), it differs from Simula/C++-style OO due to using dynamic dispatch (late binding), i.e., selecting which implementation of a polymorphic operation (method or function) to call at run time instead of at compile time.

It had significant influence on the development of the personal computer. Projects at Apple (Lisa/Mac) and Microsoft (Windows) were influenced by the Smalltalk GUI and Smalltalk was also the basis for Objective C, the language behind the NeXT/MacOS/iOS UI frameworks - now on the way to be supplanted by Swift.

More details, as usual, on Wikipedia: https://en.wikipedia.org/wiki/Smalltalk

Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by JKCalhoun on Sunday January 01, 2023 @03:58PM (#34210792)
I knew of Smalltalk but was unaware it was 1) byte code rather than compiled and 2) it influences Objective C. Very cool.

Seeing also Pascal, Modula, Forth, Prolog... The 70's were an innovative era for programming languages. https://en.wikipedia.org/wiki/Timeline_of_programming_langua...

Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by pinewurst on Sunday January 01, 2023 @04:20PM (#34211041)
It also introduced (in its later ParcPlace form) the idea of JITing interpretive languages.
Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by pjmlp on Monday January 02, 2023 @03:48AM (#34215810)
All Xerox PARC environments (Interlisp, Smalltalk, Mesa, Cedar) were bytecode based, because their CISC CPUs were microcoded.

So the first thing a machine would do on boot would be to load the right microcode into the CPU, and then those bytecodes were effectively the Assembly language for the CPU.

They were also the genesis of the first JIT compilers, and the OpenJDK Hotspot traces back its heritage to StrongTalk JIT compiler.

Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by infinite8s on Monday January 02, 2023 @10:50AM (#34219170)
One slight difference from current microcoded CPUs is that the end user could implement their own microcode. So each of the systems you mention above implemented their VMs directly in microcode, and as a result tye bytecode became the instruction set for this 'virtual' machine.
Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by bogomipz on Sunday January 01, 2023 @10:37PM (#34213969)
>"Smalltalk is a programming language (+runtime, GUI, development environment) that originated at the Xerox PARC research center in the early 1970s ..."

I'm curious was it used as a standalone OO language outside of GUI development as well or was its primary focus for building graphical UIs?

Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by johndoe0815 on Monday January 02, 2023 @02:26AM (#34215301)
There are definitely applications of Smalltalk outside of GUI development, e.g. in robotics: http://www.esug.org/wiki/pier/Robotics

One example is NXTalk, a Smalltalk system (with its own VM implementation that differs from Smalltalk-80) developed in Robert Hirschfeld's research group (hi Michael! :)) at HPI. NXTalk runs on second generation (ARM7-based) Lego Mindstorms robots in 64kB RAM and 256kB Flash:

https://www.hpi.uni-potsdam.de/hirschfeld/projects/nxtalk/in...

There's also a related discussion about Smalltalk use cases at c2.com: https://wiki.c2.com/?WhatsBeenDoneInSmalltalk

Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by marvel_boy on Sunday January 01, 2023 @03:15PM (#34210372)
Really it is a shame that lots of people on tech have never hear of Smalltak. It is in my humble opinion the most influential language ever created. Ask anyone who played with Smalltak in the 80's and they will say the same: "I never ever will have the sensation of power and confidence that Smalltak provided".
Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by layer8 on Sunday January 01, 2023 @03:24PM (#34210465)
I think “most influential” is debatable. In the space of OO languages that found widespread adoption, more seem to be influenced by the Simula-C++ lineage (notwithstanding counterexamples like Objective-C and Ruby).
Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by glacials on Sunday January 01, 2023 @03:47PM (#34210691)
I find an sample of Smalltalk is one of the most interesting ways to see how it flows as a language, as its grammar almost reads like English. From Wikipedia [1], this is a piece of Smalltalk code:

> 3 factorial + 4 factorial > between: 10 and: 100

which means:

> 3 receives the message "factorial" and answers 6 > 4 receives the message "factorial" and answers 24 > 6 receives the message "+" with 24 as the argument and answers 30 > 30 receives the message "between:and:" with 10 and 100 as arguments and answers true

[1]: https://en.wikipedia.org/wiki/Smalltalk

Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by worik on Sunday January 01, 2023 @04:37PM (#34211240)
> as its grammar almost reads like English.

Really? How different our interpretations can be, that is incredibly opaque too me. Even reading your explanation I do not understand it.

Horses for courses, I guess

Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by tinco on Sunday January 01, 2023 @06:49PM (#34212485)
glacials made a typo that makes their explanation harder to folow. The correct smalltalk is:

    3 factorial + 4 factorial between: 10 and: 100
And the point about it reading like English is that because the syntax relies heavily on their fancy precedence rules you can make complex expressions without needing parentheses I think. It looks like the compiler magically knows what is meant by the expression, but the reality is that you need to be very aware of the grammar to be able to write it. It does look pretty in my opinion, but definitely opaque to someone not aware of the rules.

    Is 3 factorial plus 4 factorial between 10 and 100?
Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by Jtsummers on Sunday January 01, 2023 @07:34PM (#34212805)
Throwing in the parenthesis:

  ((3 factorial) + (4 factorial)) between: 10 and: 100.
Otherwise it's just left to right processing:

  3 + 4 * 10.
Becomes 70 as a consequence of these rules, the parser is pretty simple.
Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by tragomaskhalos on Sunday January 01, 2023 @06:56PM (#34212547)
The precedence rules are: unary > binary > keyword. That's it. Various criticisms have been levelled at Smalltalk, but it's a very long stretch to claim that it is difficult for humans to learn.
Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by tinco on Sunday January 01, 2023 @08:15PM (#34213075)
Good thing that no one was claiming it is difficult to learn. Those precedence rules are very fancy indeed.
Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by worik on Monday January 02, 2023 @09:00PM (#34226584)
Yes. Clear as mud
Re:Smalltalk-80 on Raspberry Pi: A Bare Metal Implementation by rahoulb on Sunday January 01, 2023 @07:46PM (#34212895)
The thing I love about smalltalk is that the language grammar has about 7 rules in it and everything else is defined as passing messages to objects.

Want to add a method? You send the class a message and pass it a block with the method contents. Want define a class? You send the parent class the subclass message. Want an if statement? You evaluate a Boolean in a block and send it the ifTrue or ifFalse messages.

It means that sometimes it reads a bit strange, but there's a purity to it I love. Plus if you don't like it you can just define your own methods - for example I once did an (unfinished) library for GNU Smalltalk that gave it a more traditional if statement and loop constructs.