<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Jan<div><br></div><div>No, no I don‘t disagree with you.</div><div>If the aim is to „just“ have an Oberon compiler on a lot of backends, then Ofront is a good way to go.</div><div>If I think of it, what I personally really like is actually not the Oberon language but the Oberon OS.</div><div>No heaviy IDE with thounds of parameters, no lengthy compile and link phases, fast development due to dynamic loading, System.Free and just execute the new command, the OS API is not as heavy as Linux. Android or Windows (admittedly not as powerful as well, but enough for embedded systems)</div><div><br></div><div>But indeed the crux of the Oberon OS is the not existing driver eco system for HW!</div><div><br></div><div><div dir="ltr">br<br><div>Jörg</div></div><div dir="ltr"><br><blockquote type="cite">Am 30.04.2020 um 00:37 schrieb Jan de Kruyf <jan.de.kruyf@gmail.com>:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">guy,<div>when I was young, and still thinking girls were stupid, I also did a hacked Oberon compiler for some micro controller.</div><div>It was a wonderful learning experience, but although the end result worked, I now would be </div><div>ashamed to show it. It was ultimately a one off for a one off job.</div><div>Since then I have learned that girls are actually quite nice and worthwhile to spend some time on,</div><div>while computer fashions change like the weather.</div><div><br></div><div>Now for the bigger picture after this digression:</div><div>As you also did find out, I guess: </div><div>Oberon is a niche language sitting somewhere in an obscure corner. I maintain that one of the causes is </div><div>that there is no compiler like gcc that has an oberon front end but that could have many different back ends.</div><div>(Joerg does not agree with me I know 🙄)</div><div>If we would stick our heads together and see if an Oberon frontend to gcc is manageable then </div><div>Oberon becomes a useful tool for many embedded controllers since there are already many back-ends.</div><div>And the building of a toolchain for cross-compilation is a well documented task, I have done it in Ada.</div><div>A binding with the hardware / libraries of a new controller can then be whipped up in a matter of days.</div><div><br></div><div>What you are proposing has been done in the past. People have constructed Oberon to C translators </div><div>(but without modifying the language), but for one reason or another none of those made it into a </div><div>productive tool that is used much. Lack of a well documented way to use foreign libraries and lack of </div><div>an easy debugging mechanism come to mind.</div><div><br></div><div>hope this stimulates your grey matter a bit.</div><div><br></div><div>j.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 29, 2020 at 2:45 PM Guy T. <<a href="mailto:turgu666@gmail.com">turgu666@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">The approach I’ve taken so far is very similar to the "Oberon-2 Programming with Windows”. Here is the modifications to the language I’ve done (from the syntax definition of Oberon-07):<div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Module           = OberonModule | CModule.</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">OberonModule     = MODULE ident ";" [ImportList] DeclarationSequence</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">                   [BEGIN StatementSequence] END ident "." .           (* No change here *)</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">CModule          = MODULE "[" CDECL "]" ident ";" [ImportList]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">                   CDeclarationSequence END ident "." .</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">CDeclarationSequence = DeclarationSequence =</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">                           [CONST {ConstDeclaration ";"}]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">                           [TYPE {TypeDeclaration ";"}]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">                           [VAR {VariableDeclaration ";"}]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">                           {CProcedureDeclaration ";"}.</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">ArrayType        = ARRAY     ["[" CDECL "]"] length {"," length} OF type.</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">PointerType      = POINTER   ["[" CDECL "]"] TO type.</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">ProcedureType    = PROCEDURE ["[" CDECL "]"] [FormalParameters].</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">ProcedureDeclaration = OberonProcedureDeclaration | CProcedureDeclaration.</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">OberonProcedureDeclaration = ProcedureHeading ";" ProcedureBody ident. (* No change here *)</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">CProcedureDeclaration = CProcedureHeading ";" .</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">CProcedureHeading = PROCEDURE ["[" CDECL "]"] identdef [FormalParameters].</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">RecordType       = OberonRecordType | CRecordType.</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">OberonRecordType = RECORD ["(" BaseType ")"] [FieldListSequence] END.  (* No change here *)</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">CRecordType      = RECORD    ["[" CDECL "]"]   [FieldListSequence] END.</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">——</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">The only change to the syntax is the use of a "[CDECL]” for elements that need to be internally managed as C elements. Internally, new forms are created for module, pointer, array procedure and record declared with "[CDECL]”. All basic Oberon types (CHAR, BYTE, BOOLEAN, SHORTINT (16 bits), INTEGER (32 bits), LONGINT (64 bits)) are the same as their equivalent in C. SET is mapped to C 32bits integer for bit-wise manipulations (0: LSB, 31: MSB). The ESP32 is using little-endian for memory addressing.</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">A CModule is the equivalent of a header file in C. No code is produced so no statements are allowed in a CModule. All elements in a CModule are C related, so the use of [CDECL] for array, record, pointer and procedure is induced. A CModule can import other CModules.</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">A CRecordType is the equivalent of a C struc. No RECORD extension is allowed.</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">C Pointers can be declared to point to any simple types and C array, C record, C pointer and C procedure. They cannot be initialized through NEW() but can be initialized through assignation.</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">C Array can be declared to point to any simple types and C array, C record, C pointer and C procedure.</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">C Procedures don’t generate name mangling as for GCC and accept only parameters that are compatible (so no Oberon array, record, pointers and procedures but their [CDECL] equivalent).</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">Guy</div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div></div>--<br>
<a href="mailto:Oberon@lists.inf.ethz.ch" target="_blank">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br>
<a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" rel="noreferrer" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br>
</blockquote></div>
<span>--</span><br><span>Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems</span><br><span>https://lists.inf.ethz.ch/mailman/listinfo/oberon</span><br></div></blockquote></div></body></html>