Author Topic: deliberately simple programming language  (Read 4039 times)

Zero

  • *
  • Autobot
  • ******
  • Posts: 204
  • Fictional character
    • AGI DEV LOG
Re: deliberately simple programming language
« Reply #15 on: August 25, 2015, 07:37:39 AM »
Then we should name it "fantASM". Big hit!  :o ;D

EDIT: So far, I have
Code: [Select]
log to console: (execute raw javascript: 5+5)working!
« Last Edit: August 25, 2015, 09:06:12 AM by Zero »
PRO|STAMINA [ programming game ]
AGI DEV LOG [ In Goto We Trust ]

Zero

  • *
  • Autobot
  • ******
  • Posts: 204
  • Fictional character
    • AGI DEV LOG
Re: deliberately simple programming language
« Reply #16 on: August 27, 2015, 02:00:54 PM »
Working on text user interface...

(inspired from Steve Dekorte's Io website)
PRO|STAMINA [ programming game ]
AGI DEV LOG [ In Goto We Trust ]

Zero

  • *
  • Autobot
  • ******
  • Posts: 204
  • Fictional character
    • AGI DEV LOG
Re: deliberately simple programming language
« Reply #17 on: September 10, 2015, 07:43:14 AM »
Hi all,

This language is evolving a bit. I wasn't happy with having colons inside parentheses, so now functions act as chatbot triggers. They're defined between curlies.

Code: [Select]
  {first name of *}
  command: argument
  command: argument
  render: something

  [regular command]
  command: argument
  insert: (first name of Joe Black)
  command: argument

Now, indentation matters. Also, the target has changed, it is now a language that compiles to a single html file, containing html5+css3+js. I still dont' have a name. PL/DS could mean "dead simple" :)


EDIT: Would "Litewave" be a good name?
« Last Edit: September 10, 2015, 10:00:36 AM by Zero »
PRO|STAMINA [ programming game ]
AGI DEV LOG [ In Goto We Trust ]

Zero

  • *
  • Autobot
  • ******
  • Posts: 204
  • Fictional character
    • AGI DEV LOG
Re: deliberately simple programming language
« Reply #18 on: September 14, 2015, 02:05:54 PM »
Indentation is maybe too much for an "easy" language. So, maybe jumping a line to mark the end of a code block would suffice. Like:
Code: [Select]

[my command]

print: Here is a list of cities I like:

for each item from: <list of cities>
print: I like <item>

print: That's it!

Nesting foreach loops wouldn't be allowed in that case.
PRO|STAMINA [ programming game ]
AGI DEV LOG [ In Goto We Trust ]

8pla.net

  • *
  • Terminator
  • *********
  • Posts: 752
    • 8pla.net
Re: deliberately simple programming language
« Reply #19 on: September 15, 2015, 01:53:19 AM »
Indentation may be one of my unfavorite things about Python, I think.
My Very Enormous Monster Just Stopped Using Nine

Zero

  • *
  • Autobot
  • ******
  • Posts: 204
  • Fictional character
    • AGI DEV LOG
Re: deliberately simple programming language
« Reply #20 on: September 18, 2015, 02:22:15 PM »
Here is a draft command set:

Code: [Select]

[list vars like]    produces a list of variables with name matching given pattern
[with]              appends its argument to <this>
[without]           removes from <this> everything matching its argument
[only]              keeps in <this> everything matching its argument
[keep before]       keeps in <this> everything before first match
[keep after]        keeps in <this> everything after last match
[about]             puts its argument in <this>
[this is]           puts what is in <this> in the variable with the given name
[forget variable]   deletes variable with given name
[raw]               produces directly its argument (without string interpolation)
<this>

[here is]              defines a label you can jump to
[jump to]              jumps to a label
[if]                   executes code only if its argument is in <truth>
[unless]               executes code only if its argument isn't in <truth>
[while]                keeps looping code while its argument is in <truth>
[until]                keeps looping code until its argument is in <truth>
[for each item from]   executes code once for each value of its argument
[if this is]           executes code only if <this> is the same as its argument
<item>

[consider]             asserts strings in <truth>
[sufficient]           asserts a "sufficient" rule
[necessary]            asserts a "necessary" rule
[put aside]            removes from <truth> strings matching its argument
[keep and formulate]   produces a list of strings based on possibilities
[formulate]            produces possibilities and delete logic variables
[forget logic]         deletes logic variables
[truth in]             saves the content of <truth> in variable with given name
[truth from]           loads the content of <truth> from variable with given name
<truth>

[list nodes like]    lists html nodes using "document.querySelectorAll()"
[select node]        selects current node using "document.getElementById()"
[remove node]        deletes node with given id
[clear node]         deletes the content of node with given id
[set as attribute]   puts <this> in given attribute of current node
[get attribute]      puts given attribute of current node in <this>
[before node put]    inserts node of given type before current node and produces its id
[after node put]     inserts node of given type after current node and produces its id
[inside node put]    inserts node of given type inside current node and produces its id
[write]              appends given text in current node
[listen]             puts a listener on current node with following code block
[ignore]             deletes a listener from current node
<node>
<ui>

PRO|STAMINA [ programming game ]
AGI DEV LOG [ In Goto We Trust ]

ivan.moony

  • *
  • Replicant
  • ********
  • Posts: 636
  • look, a star is falling
Re: deliberately simple programming language
« Reply #21 on: September 18, 2015, 03:44:38 PM »
I have to admit I don't fully understand your language all the time, while it is ought to be simple, but maybe it's just me and my silly mind...

Are those recent commands ought to be built in? How should they be written in use examples? Can there be arbitrary content inside [...] brackets? The only thing I think I understood is that after [...] brackets follows something that belogs to them, like a function, or maybe I got that wrong too?

I'd like, once when you're finished, to read a tutorial (if you ever get to that point), so don't mind me for now, I don't want to put unproductive influences to your ideas.

ivan.moony

  • *
  • Replicant
  • ********
  • Posts: 636
  • look, a star is falling
Re: deliberately simple programming language
« Reply #22 on: September 18, 2015, 08:44:11 PM »
Never mind... I finaly got it (I think). There is built in set of commands, but you can also write your own compound commands.

Zero

  • *
  • Autobot
  • ******
  • Posts: 204
  • Fictional character
    • AGI DEV LOG
Re: deliberately simple programming language
« Reply #23 on: September 19, 2015, 02:21:46 PM »
Sorry, I wasn't able to respond sooner. Thanks a lot for your input!

So yes, you got it. What I call "commands" here are named "subs" in basic, "procedure" in pascal, "function" in C. My previous post was a list of built-in commands.

To define a new command, you put its name between square brackets. Programs always start by executing the "main" command. So a basic hello world would be:

Code: [Select]
  [main]

  print: Hello world!

It's a little bit early to write a tutorial, but when I'm done I'll make one, and if this tutorial is not clear, maybe you can help me make it better :)

PRO|STAMINA [ programming game ]
AGI DEV LOG [ In Goto We Trust ]

yotamarker

  • *******
  • Starship Trooper
  • Posts: 465
Re: deliberately simple programming language
« Reply #24 on: March 23, 2016, 09:15:15 PM »
without nested statements ? does it mean you can't use for loops ?

Zero

  • *
  • Autobot
  • ******
  • Posts: 204
  • Fictional character
    • AGI DEV LOG
Re: deliberately simple programming language
« Reply #25 on: March 25, 2016, 01:37:06 PM »
In Goto We Trust
(Oh ye of little faith)
 ;D
PRO|STAMINA [ programming game ]
AGI DEV LOG [ In Goto We Trust ]

 

Welcome

Please login or register.



Login with username, password and session length
Russian Military Robots
by Art (Robotics News)
April 25, 2017, 06:14:30 PM
DeepMind
by Art (AI News )
April 19, 2017, 06:19:36 PM
A Murder Posted on Facebook Prompts Outrage and Questions Over Responsibility
by Art (AI News )
April 18, 2017, 10:12:52 AM
AI based 3d scanner
by Art (AI News )
April 18, 2017, 10:04:39 AM
Artificial Earthling
by Art (AI News )
April 14, 2017, 03:49:08 PM
Faster websites with fewer bugs
by Tyler (Robotics News)
April 13, 2017, 10:50:45 PM
New Tools Needed to Track Technology’s Impact on Jobs, Panel Says
by Tyler (AI News )
April 13, 2017, 10:50:43 PM
SMART automation
by Tyler (Robotics News)
April 13, 2017, 04:48:34 PM

Users Online

16 Guests, 2 Users
Users active in past 15 minutes:
yotamarker, Freddy
[Administrator]
[Starship Trooper]

Most Online Today: 28. Most Online Ever: 208 (August 27, 2008, 08:24:30 AM)

Articles