flat assembler
Message board for the users of flat assembler.

flat assembler > Programming Language Design > My programming language

Author
Thread Post new topic Reply to topic
booter



Joined: 08 Dec 2006
Posts: 67
I wrote lexer/parser for the new language. The idea is to create a high level language with assembly-like philosophy (pointers and goto, not variables and "structural programming"). My approach is exactly opposite to HLA.
In his "A Case against the GO TO Statement" Edsger W.Dijkstra wrote: "our intellectual powers are rather geared to master static relations and that our powers to visualize processes evolving in time are relatively poorly developed." I'd say, people of that kind don't like Assembler, but there are others, who think differently and love asm.
Anyways, I'm trying to find the best solution for the code generation (in FASM). Your suggestions would be appreciated.
I'm thinking about parser/lexer creating not the tree of data structures, but program code, which then get compiled into code generator specific to the source program (much simpler and may be even faster). Have you heard anybody did it like that?
Post 13 Nov 2018, 16:31
View user's profile Send private message Reply with quote
pabloreda



Joined: 24 Jan 2007
Posts: 89
Location: Argentina
I recommend that you read
http://thinking-forth.sourceforge.net/
it's another approach to goto conversion in a goto-free language, the spaghetti code is famous in basic !!
Post 16 Nov 2018, 18:52
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2335
Location: Usono (aka, USA)
What exactly do you mean with "structural" programming?

Even Fortran-77 was supposedly "structured" (but no dynamic malloc / heap). Normally that means less reliance (or totally avoiding) global GOTO (which classic Pascal reluctantly supported but Modula-2 and Oberon omitted).

Do you mean dynamic memory allocation of structured types (aka, arrays or records)?
Or just using non-ordinal types, thus arrays or structs/records on the global or local (stack) level?
Or do you mean structured flow control like while, for, repeat ... until, loop, etc?

Dijkstra was an ALGOL expert and eschewed classic BASIC (back before others like MS QBASIC added all the structured stuff in). Similarly, Pascal was a heavy proponent of structured programming, and Wirth was even the editor of that GOTO article. It's not that you can't use GOTO but rather that it's often overused and messy.

Maybe you want to look at BCPL first?

EDIT: Look at Wirth's free Compiler Construction book (2013-ish).
Post 05 Apr 2019, 21:15
View user's profile Send private message Visit poster's website Reply with quote
MarcoV



Joined: 28 Apr 2019
Posts: 4
booter wrote:
I wrote lexer/parser for the new language. The idea is to create a high level language with assembly-like philosophy (pointers and goto, not variables and "structural programming"). My approach is exactly opposite to HLA.


Pascal and Modula2 are considered "structured programming", maybe even quintessentially so. Yet they have both pointers and goto.

It is not about having pointers and goto or not, it is about not wallowing in them.
Post 27 May 2019, 21:13
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.