deliberately simple programming language

  • 25 Replies
  • 10903 Views
*

Zero

  • Eve
  • ***********
  • 1287
Re: deliberately simple programming language
« Reply #15 on: August 25, 2015, 08:49:39 am »
Then we should name it "fantASM". Big hit!  :o ;D

EDIT: So far, I have
Code
log to console: (execute raw javascript: 5+5)
working!
« Last Edit: August 25, 2015, 10:18:12 am by Zero »

*

Zero

  • Eve
  • ***********
  • 1287
Re: deliberately simple programming language
« Reply #16 on: August 27, 2015, 03:12:54 pm »
Working on text user interface...

(inspired from Steve Dekorte's Io website)

*

Zero

  • Eve
  • ***********
  • 1287
Re: deliberately simple programming language
« Reply #17 on: September 10, 2015, 08:55: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
  {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, 11:12:36 am by Zero »

*

Zero

  • Eve
  • ***********
  • 1287
Re: deliberately simple programming language
« Reply #18 on: September 14, 2015, 03:17: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

[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.

*

8pla.net

  • Trusty Member
  • ***********
  • Eve
  • *
  • 1307
  • TV News. Pub. UAL (PhD). Robitron Mod. LPC Judge.
    • 8pla.net
Re: deliberately simple programming language
« Reply #19 on: September 15, 2015, 03:05:19 am »
Indentation may be one of my unfavorite things about Python, I think.
My Very Enormous Monster Just Stopped Using Nine

*

Zero

  • Eve
  • ***********
  • 1287
Re: deliberately simple programming language
« Reply #20 on: September 18, 2015, 03:34:15 pm »
Here is a draft command set:

Code

[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>


*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: deliberately simple programming language
« Reply #21 on: September 18, 2015, 04:56: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

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1729
    • mind-child
Re: deliberately simple programming language
« Reply #22 on: September 18, 2015, 09:56: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

  • Eve
  • ***********
  • 1287
Re: deliberately simple programming language
« Reply #23 on: September 19, 2015, 03:33: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
  [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 :)


*

yotamarker

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1003
  • battle programmer
    • battle programming
Re: deliberately simple programming language
« Reply #24 on: March 23, 2016, 09:27:15 pm »
without nested statements ? does it mean you can't use for loops ?

*

Zero

  • Eve
  • ***********
  • 1287
Re: deliberately simple programming language
« Reply #25 on: March 25, 2016, 01:49:06 pm »
In Goto We Trust
(Oh ye of little faith)
 ;D

 


LLaMA2 Meta's chatbot released
by spydaz (AI News )
August 24, 2024, 02:58:36 pm
ollama and llama3
by spydaz (AI News )
August 24, 2024, 02:55:13 pm
AI controlled F-16, for real!
by frankinstien (AI News )
June 15, 2024, 05:40:28 am
Open AI GPT-4o - audio, vision, text combined reasoning
by MikeB (AI News )
May 14, 2024, 05:46:48 am
OpenAI Speech-to-Speech Reasoning Demo
by MikeB (AI News )
March 31, 2024, 01:00:53 pm
Say good-bye to GPUs...
by MikeB (AI News )
March 23, 2024, 09:23:52 am
Google Bard report
by ivan.moony (AI News )
February 14, 2024, 04:42:23 pm
Elon Musk's xAI Grok Chatbot
by MikeB (AI News )
December 11, 2023, 06:26:33 am

Users Online

345 Guests, 0 Users

Most Online Today: 345. Most Online Ever: 2369 (November 21, 2020, 04:08:13 pm)

Articles