Skip to content

A small language for writing terse, fast, and memory efficient data processing programs

Notifications You must be signed in to change notification settings

zdandoh/dandelion

Repository files navigation

Dandelion

Build status codecov

Dandelion is a small language that intends to be useful for quickly writing terse utility/text processing programs. The goal of the project is to serve as a replacement for arcane bash incantations and some Python scripts.

Dandelion is statically typed, but uses global type inference, so type annotations generally don't need to be provided. The compiler leverages LLVM to provide native binaries and an interpeted mode (with JIT). Dandelion was designed to provide the programmer the ability to write terse programs that are comparable in performance to C, while exceeding the expressiveness of Python. Below is an example of a simple grep program written in Dandelion:

collect("*.txt") -> lines ->> fi{ "substr" in e } -> p

(This utilizes one of the headline features of Dandelion - pipelines. Imagine classic shell pipelines but connecting functions/coroutines instead of independent executables. I will write more about this later.)

I am currently working on implementing core language features (rough checklist below). To get an idea of where the language is at, you can check out the tests in compile_test.go

Language Features

  • Primitive data types: bool, int, float, string, byte
  • Tuples
  • Lists
  • Structs
  • Functions
  • Struct methods
  • Pipelines
  • Global type inference (WIP - can't handle all cases)
  • Type annotations (for when types can't be inferred)
  • Closures
  • Implicit return values
  • Classic imperative control flow (if, while, for, break, continue, return)
  • Function modifiers
  • Coroutines
  • GC
  • Comments
  • Command invocation syntactic sugar
  • String interpolation
  • Automatic semi-colon insertion
  • Cross platform (Windows, Mac, & Linux)

Planned Features

  • Regex support
  • Escape analysis
  • Hash tables
  • Basic standard library
  • JSON construction/parsing
  • Python interface system

About

A small language for writing terse, fast, and memory efficient data processing programs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published