Skip to content

Instantly share code, notes, and snippets.

@duckinator
Created January 1, 2018 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duckinator/f03f0ae1c64328a7faf8a9c73ca81ebd to your computer and use it in GitHub Desktop.
Save duckinator/f03f0ae1c64328a7faf8a9c73ca81ebd to your computer and use it in GitHub Desktop.

Lisp thingy

  1. should be small
  2. easily embeddable
  3. inspired by scheme, probably, but a lot simpler/less full-featured

requirements

should be small/easily embeddable

because fuck it i'm lazy and it's supposed to be in the kernel itself.

needs a way to fuck with RAM

i think i'm okay with that being done via functions.

you'd probably need to specify the type in some way.

you'd probably need to specify the size, too. TODO: figure out how to do this.

e.g., using the notation where ":blah" is an atom (I think that's the lisp-y term)/symbol (Ruby term),

(memory-write address :uint32 value)
(memory-read address :uint32 value)

or something like that, idk.

absurdly easy to parse

bonus points if it can be parsed without any backtracking whatsoever.

i think this is doable, although idk if it'll be worth the effort to have absolutely no backtracking. we'll see.

questions

  1. type system? some (but not all) possibilities:

    a. some kind of robust thing

    b. a really freaking lazy one that only has one type and everything is worked with via duck typing

    UNIVERSAL FEEDBACK SEEMS TO BE THAT TYPES ARE GOOD

    Was recommended https://www.amazon.com/exec/obidos/ASIN/0262162091/benjamcpierce?pldnSite=1 for reading

  2. should it have a bytecode VM in the kernel, and just have a bytecode compiler that runs with fewer privileges whenever possible?

    a. the "runs with fewer privileges" can be deleyed indefinitely tbh, but the decision may influence the language design or implementation details so i'd like to decide sooner rather than later


Alternatively, could make it a not-lisp, probably strongly Python inspired? (and possibly with a more robust(?) type system.)

class Foo():
    def __init__(self):
        self.thing = "meep"

     def toString(self):
         return(self.thing)

     def bar(self, baz: String):
         return(str(self) + " " + baz)

def __main__():
        foo = Foo()
        println(foo.bar("meep")) #=> "foo meep"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment