[Oberon] FPGA - OberonV4 Dialogs
skulski at pas.rochester.edu
Thu Nov 15 17:51:38 CET 2018
all these topics of metaprogramming and serialization of data structures were implemented in BlackBox. You will gain a lot of insight from studying BlackBox documentation which is distributed together with BlackBox environment.
A spectacular demonstration of metaprogramming is the automatic BlackBox GUI builder which analyzes the compiled module and builds a GUI based on the results of this analysis. Based on my own experience, I dare say that 90% of a GUI project time is devoted to classic GUI programming, which BlackBox can eliminate. Billions of dollars could be saved by adopting BlackBox. (My own claim...) This may be the reson why BB was not successful in the market. Who wants to save? Spending is more lucrative than saving.
If you want to explore this topic, download and install BlackBox from the CPC website, and then download and install my graphical package Gr. Compile Gr, and then open the interactive Gr User Guide where I am explaining in great detail how BB metaprogramming is used to quickly assemble impressive GUI packages under BlackBox.
From: Oberon [oberon-bounces at lists.inf.ethz.ch] on behalf of Jörg [joerg.straube at iaeth.ch]
Sent: Thursday, November 15, 2018 4:52 AM
To: ETH Oberon and related systems
Subject: Re: [Oberon] FPGA - OberonV4 Dialogs
As long as you have an ARRAY or a RECORD with some INTEGER fields or so, WriteBytes is okay.
But whenever you have POINTERs in your data structure, you can't just dump the memory to disk.
The next time you load that structure into memory again, your heap most probably looks totally different and the stored pointers on disk are not pointing to the correct data again.
So, while loading you have to properly allocate your pointer data structure again with NEW. To be able to call NEW you need info on the type you want to allocate on the heap. Either you store the type info you got by the module Type.Mod or - cleaner - you call an instantiation routine of the module where you imported the POINTER from and let that module do its job.
Am 15.11.18, 10:25 schrieb "Oberon im Auftrag von Tomas Kral" <oberon-bounces at lists.inf.ethz.ch im Auftrag von thomas.kral at email.cz>:
Not sure I got the idea of "externalisation" right, but I have tested
loading and storing structured data using optimised Read/WriteBytes().
My understanding is, that I need a way to instantiate run time type
data with persistent data on disk?
Tomas Kral <thomas.kral at email.cz>
More information about the Oberon