Skip to content

Instantly share code, notes, and snippets.

@dallinbeutler
Last active November 4, 2019 20:08
Show Gist options
  • Save dallinbeutler/4305005ae4579c7519624ea6c164d8d4 to your computer and use it in GitHub Desktop.
Save dallinbeutler/4305005ae4579c7519624ea6c164d8d4 to your computer and use it in GitHub Desktop.

Priorities

  • easy Monad application, ordering, and usage
  • easy function currying (front,back, whatever)
  • static typing
  • easy and readable scoping (.operators, pointer operators)?
  • inline lambdas identical to function declarations
  • emphasis on pure function usage and visibility (make side-effects like exceptions stick out like a sore thumb)
  • first class macros based on language AST rather than text (T4/TT like)(the main issue with C macros)
  • lowest possible interop cost to C (possible inline C usage to prep binding? not ideal and not preferable)
  • easy pooling
  • easy multithreading
  • prioritize the immutability mindset
  • Discriminated/Tagged Unions and pattern matching

Theoretically Awesome Features

  • true algebra functions? Or, a function where you can plug in the result as a param, and it works backwards.
    • i.e. plug in any combination of a, b, and c for pythagorean theorem)
    • The biggest issue for this is that floating point number calculations won't be deterministic
  • macro precompilation previews.
  • inline Jupyter Notebooks visualization.
  • default to a loop (this would add possible functionality, readability, and performance improvements for turning immutable into mutable types...)
  • threadsafe pointer mode that diffs changes and merges when possible
  • native adaptive/Reactive support
  • windowing and fancy console support built into core libraries
  • the only difference between static and member functions is the first type passed in.

Possible Language Design Choices

  • custom infix operators?
  • only prefix operators? or only infix?
  • no operator precedence?
  • garbage collect everything by default unless explicitly kept?
  • control over GC time
  • line breaks at beginning of line? or whitespace delimited?
  • make shadowing functions/vars more explicit

Some Idea Examples:

variable declaration

pi: 3.1415926f

function declaration

pow: x y -> x ** y

hypoteneuse: a b -> sqrt ((a ** 2.0f) + (b ** 2.0f))

elevate to option monad

possible_float: option pi 
possible_float: null 

currying

addMult: x y z -> (x + y) * z
//we pick which positions in function we wish to curry. in this case, skip pos 1, take pos 2 and 3
addMult _ 2 3 // result: function:x -> (x + 2) * 3

addMult _ 2   // result: function:x y-> (x + 2) * y 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment