flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Programming Language Design > Plain English Programming

Goto page Previous  1, 2, 3, 4, 5
Author
Thread Post new topic Reply to topic
codestar



Joined: 25 Dec 2014
Posts: 254

Quote:
The problem I have with typeless languages is that it forces us to give names to things that we would normally identify by type (a box, the screen, some pixels).

For Plain English, it seems appropriate to omit names, but in Abakis, there are advantages in using names and aliases.

Code:
; bmi.xpm=0 ; compare this to...

put 0 into the BITMAPFILEINFO's xPixelsPerMeter

What about macros and constants?

Code:
x=0
put 0 into the numeric constant named x

How could this macro be written in English and not cause conflict with the runtime language? Returns sum in constant a=. Macro parameters are local names only and the usage determines what they are (numeric or symbolic constant, runtime variable, etc).

Code:
macro c.add ab { a=a+b }

x=1        ; example...
y=2
c.add xy ; result: x=3


Quote:
... it forces us to give names to things that we would normally identify by type (a box, the screen, some pixels...

draw_rectangle(r);
draw_circle(c);

We could say: "draw box r" or "draw r which is a box".

Code:
; draw(box b, style s)

; "draw box b with style s"

; "draw a box named b with
;    the style named s"

box b
style s
; ...
draw_box bs


Quote:
("I want to improve Lisp, or C, or whatever") is the problem

Agree. Abakis was designed with no reference and no thought that it should be an "improvement of X". Only uses standard names - function, byte, int, etc - recognized by most programmers and the pointer notation in C and M68K ASM - which were afterthoughts. Unique semantics. Example:

Code:
function test.file
  locals n
  get n=text.n t
  try create f
  write tn
  close
  try open f
  read sn
  say s
  close
  execute f
endf 1

while cc=*p++, endwp-sp--

. p=aq=bn>>>2
loop n, (u32) *p++=*q++, endl

while s<ec=*s, *s++=*e, *e--=cendw

if n=0, *p++='0', *p=0
  return s
end

loop nc=*s++, *p++=c
  if c=0breakend
endlp--

while cc=*s++, *p++=cendwp--

while c=dc=*p++, d=*s++
  if c=0breakend
  if d=0breakend
endwp=cp-d

while nx=nx&1x+'0'
  . *p++=xn>>>1
endw, *p=0

foreverc=*p++
  if c=0return nend
  . x=nx<<2n+xn+n
  . n-'0'n+c
endfv

Recently, I've been working on C-ish style macro languages in FASMG for many reasons; To help/teach FASMG; No one else here can/will do this; More programmers know C = more users; Easy conversions to/from C; It can be "portable" (multi-CPU, multi OS); To offer an alternative to C (some programmers have no choice but to use C/C++ for work or Android); Never seen a good "improvement of C" with redesigned syntaxes, only additions to C (ie, start with C then add to it); Smaller than TinyCC; It makes Abakis look better in comparison.

Quote:
It's not a matter of intelligence; it's a matter of "unlearning" artificial ways of thinking. It's a matter of "getting back to one's roots".

... It's as if a small child was trying to think about nouns and verbs and adjectives when first learning to speak. The problem isn't that that you're "not bright enough" -- it's that you know too much...

Unlearning is a hard thing to do. I've been practising it for the most of my adult life and it still feels as difficult as it probably was in the beginning.


Quote:
How to be original? My rules to myself:

* Unplug internet, too many distractions
* Forget everything you've learned
* Ignore everyone, especially their thoughts and ideas on programming
* Don't use references unless you absolutely have to
* Think "unique", "what's needed". Avoid looking at your own previous creations. Buddha: "I never see what has been done; I only see what remains to be done"
* Do whatever you need to relax; example: hot bath, coffee, Nesquick, real wine (Gallo, Sutter Home), natural medicine. Make yourself comfortable, concentrate

Post 04 May 2015, 23:44
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6357
Location: Kraków, Poland
I find some of the discussions happening in this thread really interesting and I'm considering creating a new sub-forum for this kind of topics, so they would not become lost inside the "heap" - perhaps a forum dedicated to the design of programming languages and compilers (the design of fasm and my new engine could also be discussed there).
Post 06 May 2015, 10:25
View user's profile Send private message Visit poster's website Reply with quote
fasmnewbie



Joined: 01 Mar 2011
Posts: 396

Tomasz Grysztar wrote:
I find some of the discussions happening in this thread really interesting and I'm considering creating a new sub-forum for this kind of topics, so they would not become lost inside the "heap" - perhaps a forum dedicated to the design of programming languages and compilers (the design of fasm and my new engine could also be discussed there).

You should have created it long time ago considering your natural talent is more towards compiler & language design. Should be attractive to other compiler writers out there that have no common forum to discuss these sort of things. Go with it.
Post 06 May 2015, 12:36
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4, 5

< 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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.