Re: [Oberon] High-level language vs assembler
Hi Chris (Glur),
That sounds like a closed-system: all the I/O has [tried to] be catered for, and is hidden behind [high-level language]
It's always been a strong objective of Prof. Wirth's language designs, that "nothing is hidden". In other words, the tedium (and tendency for programmer error) of machine-code programming should be removed, but otherwise it should be pretty obvious what the code is going to do at the machine-level. (Compare that with most contemporary languages!) This philosophy is extremely clear from the compiler design notes on his home page http://www.inf.ethz.ch/personal/wirth/ in the section Oberon (for the ARM), and in Miscellaneous (for PICL, a language for Microchip Technology Inc.'s 8-bit PIC microcontroller). In the 2013 update to Project Oberon (in the Project Oberon section), there is no assembler present or required - the entire operating system is written in high-level code. Yet the system runs (and self-compiles) efficiently on a 25MHz RISC processor and graphical display in considerably less than 1MB RAM. It's well worth studying, to see how that was achieved (for this reason alone, even if not for any other!). Cheers, Paul
]> That sounds like a closed-system: all the I/O has [tried to] be catered ]> for, and is hidden behind [high-level language] ] It's always been a strong objective of Prof. Wirth's language designs, ] that "nothing is hidden". ] In other words, the tedium (and tendency for programmer error) of ] machine-code programming should be removed, but otherwise it should be ] pretty obvious what the code is going to do at the machine-level. ] (Compare that with most contemporary languages!) Correct: it's called "information hiding" in CS. ] This philosophy is extremely clear from the compiler design notes on his ] home page ] ] http://www.inf.ethz.ch/personal/wirth/ ] ] in the section Oberon (for the ARM), and in Miscellaneous (for PICL, a ] language for Microchip Technology Inc.'s 8-bit PIC microcontroller). ] ] In the 2013 update to Project Oberon (in the Project Oberon section), ] there is no assembler present or required - the entire operating system is ] written in high-level code. I vaguely remember being well impressed by PICL. But trying to force asm-concepts into an Oberon-like notation, eg. SYSTEM.Memory(SetSpeedReg, 47) feels like useing prose to replace musical-notation, or maths-formulars. Yes, there's no need to keep the now inappropriate original notation of the 60s: "mov R8,47". I suggest #47 -> R8 conveys the concept, in a minimalist/most-economic way. But this is all about cognitive science...I guess. Related to this question of notation, perhaps PASCALs notation's advantage for beginners, becomes over ruled by eg. C's { kwikNdirtySlang } notation? == Chris Glur.
-----Original Message----- From: eas lab [mailto:lab.eas@gmail.com] Sent: Wednesday, 22 October 2014 10:14 AM To: paulreed@paddedcell.com; ETH Oberon and related systems Subject: Re: [Oberon] High-level language vs assembler
But trying to force asm-concepts into an Oberon-like notation, eg. SYSTEM.Memory(SetSpeedReg, 47) feels like useing prose to replace musical-notation, or maths- formulars.
Yes, there's no need to keep the now inappropriate original notation of the 60s: "mov R8,47". I suggest #47 -> R8 conveys the concept, in a minimalist/most-economic way. But this is all about cognitive science...I guess.
Whichever notation you prefer is inconsequential. The mental effort required to reliably and efficiently manipulate register usage and memory locations is a task much better performed by machines than humans. This is particlarly so with RISC designs with 16 or more registers at your disposal. The SYSTEM-type facilities allow you to perform low-level ASM-like operations on high-level structured data items without having to manually juggle with registers and keep track of absolute addresses. Regards, Chris Chris Burrows CFB Software http://www.astrobe.com
OK, some V4 code was the nearest example:-- codebase := S.ADR(m.code[0]); dummy := pthreadMutexLock(S.ADR(critRegion)); WHILE i <= N DO ptr := S.VAL(FreeBlockPtr, A[i]); WHILE ptr # NIL DO INC(avail, ptr^.size); ptr := S.VAL(FreeBlockPtr, ptr^.next) END; INC(i) END; ---------- It is of course MUCH simpler/better than asm, especially when hiding the *SYSTEM*. It's been decades since I used an assembler, but they obviously also have <symbolic identifiers>. Having Oberon return the value of the byte pointed to by Adr(Pointer), is not the same as generating the corresponding machine-code, suitable for eg. a video-driver. I used to wiring-pen-build 8-bit Uprocs, which I programmed via my P-code interpreter. The PASCAL-like source code could do anything, but only at VirtualMachine speed. Then I threw-together an assembler [written in my same old PASCAL] which directly translated the 68xx instructions from a rA+rB ->rB type syntax. I don't remember why. Perhaps it was to make the P-code interpreter, for the 68xx VM, programmed by the orginal Z80 system from Microsoft, which came on a cassette and an A4-sized-pages pamphlet. M$ had copied NW's ver0 straight out of the book. Rather than the recursive-descent compiler, I prefered my read-and-translate the railway-diagrams version, which I orginally built to drive instruments, via a HP-desktop-calculators, which had only a BASIC type syntax. At the time, PASCAL was a fad, and a BYTE article-series had an implementation in BASIC; from which I was able to see that eg. 'when the train went past' CONST, it had to get ready to create the symbol-table-entry.... == Chris Glur. On 10/22/14, Chris Burrows <chris@cfbsoftware.com> wrote:
-----Original Message----- From: eas lab [mailto:lab.eas@gmail.com] Sent: Wednesday, 22 October 2014 10:14 AM To: paulreed@paddedcell.com; ETH Oberon and related systems Subject: Re: [Oberon] High-level language vs assembler
But trying to force asm-concepts into an Oberon-like notation, eg. SYSTEM.Memory(SetSpeedReg, 47) feels like useing prose to replace musical-notation, or maths- formulars.
Yes, there's no need to keep the now inappropriate original notation of the 60s: "mov R8,47". I suggest #47 -> R8 conveys the concept, in a minimalist/most-economic way. But this is all about cognitive science...I guess.
Whichever notation you prefer is inconsequential. The mental effort required to reliably and efficiently manipulate register usage and memory locations is a task much better performed by machines than humans. This is particlarly so with RISC designs with 16 or more registers at your disposal.
The SYSTEM-type facilities allow you to perform low-level ASM-like operations on high-level structured data items without having to manually juggle with registers and keep track of absolute addresses.
Regards, Chris
Chris Burrows CFB Software http://www.astrobe.com
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
participants (3)
-
Chris Burrows -
eas lab -
Paul Reed