Skip to content
mktipPublic

About

A toy programming language

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bang

You either shoot the problem in the foot, or shoot yourself in the foot

Ideas that might be added

  • Programıng language that itself is just an AST, single format for the AST, the AST is what's being version tracked, the actual code could be presented in many various ways without issues, everyone has their own viewing tiles, think unison?
  • Easy modifiability: https://macoy.me/blog/programming/SelfModifyingApplications
  • Unprintable strings (for secrets) (shreded once deconstructed?)
  • Native Pipes (|> or | as a pipe symbol) (maybe support for branched pipes?)
  • Easy nested maps: for easy nested maps within pipes for instances, maybe the following syntax. Could be adapted (Surrounded with one pair of [] means a map, being surrounded with two pairs of [[]] means a map on a map)
[11, 22, 33, 44]
   |> [to_char_arr]
   |> [[fun c: c - 1]]
  • Easy Syntactic sugar for a function which runs itself and passes the output of itself to itself, is this some sort of reduce call? Could it be thought of as such? Is there a nicer way to represent it? (might be useful for functional game state steping functions/clocks)
  • Easy introspection of pipes (think Debug.log/#[derive(Debug)] as a function to map that would print whatever data is in the pipe and return it to the pipe)
  • Easy dict creation, easy dict modification, everything is a dict?
  • Maybe immutable
  • Easy way to break out of nested loops, a way to break out of an if list, without labels/goto
  • A single term to create data structures, and the only data structures a user can make are product and sum types, they way they are defined will be the same, a product type is a field of a sum type with only one field in a way
  • Add support for branded/nominal types (helpful in simulating state machines maybe? Can have security benefits?)
  • Add currying
  • Coroutines? https://ayazhafiz.com/articles/23/a-lambda-calculus-with-coroutines-and-heapless-closures
  • Generate Train diagrams from the grammar https://en.wikipedia.org/wiki/Syntax_diagram like json?
  • Env as variables? Passing Env around?
  • Everything is a function? prematives are always functions which if called return themselves? (but then how do you ever access them and perform operations on them?)
  • Parser Language with some sort of internal verification? (can enforce identifiers to have different names?)

Todo

  • Write simple evaluator
  • Evaluate infix arithmetic operations
  • Evaluate let statements
  • Evaluate fun definitions
  • Evaluate fun calls
  • Add "(" expr ")"
  • Add pipes

Resources to draw insperation from

About

A toy programming language

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages