TokenLine flat syntax

  • 1 Replies
  • 1744 Views
*

Zero

  • Eve
  • ***********
  • 1287
TokenLine flat syntax
« on: July 05, 2018, 10:40:00 am »
Hi,

For authoring chatbots, or anything heavily string-based (like interactive fiction), there's a need for a syntax that would ease as much as possible the writing process of programs that contain a lot of constant strings.

If you break down any syntax to its smallest constituents, you find characters. Every language starts with a flat sequence of characters. The meaning of these characters is then defined to express nesting structures ...etc.

Hence the simplest syntax would be to have one token per line. Indentation doesn't even matter, one token per line is enough (just like a sequence of character is enough) to express structures of any complexity-level.


category
pattern
* told me to say *
template
one of
Why would #1 tell you to say "#2"?
Did you say "#2" after #1 told you to?
end one of


Let's try a good'ol naive fib!


function
fib
arg
number
body
return
if
less than
number
3
then
1
else
sum
fib
substract
number
1
end substract
end fib
fib
substract
number
2
end substract
end fib
end sum
end if
end function


Do you like it korrelan?  ;D


Ed: Of course for real usage, indentation makes it readable, if you don't mind applying trim() everywhere.


function
    fib
    arg
        number
    body
        return
            if
                less than
                    number
                    3
            then
                1
            else
                sum
                    fib
                        substract
                            number
                            1
                        end substract
                    end fib
                    fib
                        substract
                            number
                            2
                        end substract
                    end fib
                end sum
            end if
end function


Applied to consnet:


define
    has car
    parameters
        argument model
        argument owner
    body
        let
            a
            new empty cons cell
        end let
        cons cell
            cons cell
                a
                car
            end cell
            is a
        end cell
        cons cell
            cons cell
                a
                argument model
            end cell
            model of car
        end cell
        cons cell
            cons cell
                a
                argument owner
            end cell
            belongs to
        end cell
end define
« Last Edit: July 05, 2018, 12:10:46 pm by Zero »

*

Korrelan

  • Trusty Member
  • ***********
  • Eve
  • *
  • 1454
  • Look into my eyes! WOAH!
    • YouTube
Re: TokenLine flat syntax
« Reply #1 on: July 05, 2018, 12:58:52 pm »
Why not go the extra step and digress right back to assembly code? Lol. ;D

 :)
It thunk... therefore it is!...    /    Project Page    /    KorrTecx Website

 


Requirements for functional equivalence to conscious processing?
by DaltonG (General AI Discussion)
November 19, 2024, 11:56:05 am
Will LLMs ever learn what is ... is?
by HS (Future of AI)
November 10, 2024, 06:28:10 pm
Who's the AI?
by frankinstien (Future of AI)
November 04, 2024, 05:45:05 am
Project Acuitas
by WriterOfMinds (General Project Discussion)
October 27, 2024, 09:17:10 pm
Ai improving AI
by infurl (AI Programming)
October 19, 2024, 03:43:29 am
Atronach's Eye
by WriterOfMinds (Home Made Robots)
October 13, 2024, 09:52:42 pm
Running local AI models
by spydaz (AI Programming)
October 07, 2024, 09:00:53 am
Hi IM BAA---AAACK!!
by MagnusWootton (Home Made Robots)
September 16, 2024, 09:49:10 pm
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

312 Guests, 1 User
Users active in past 15 minutes:
squarebear
[Trusty Member]

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

Articles