Git Product home page Git Product logo

wulp's Introduction

Wulp

Scripting language that compiles to lua.

Syntax

syntax

Some notable changes from lua:

  • Use {} instead of do, then, end etc
  • Using an undeclared variable is a compile time error instead of silently making a global
  • Added += and friends
  • Arrays are zero indexed
  • No metatables. The current syntax aims to codify a few common idioms, giving you only one way of doing things.

See the examples for more.

There is syntax highlighting and completions package for Sublime text in the sublime folder.

Lua backend

  • Using luajit as a backend is a viable strategy for quickly iterating on a language
  • Lua code is easy to generate
  • Luajit fast
  • I started this project by just forking an existing lua parser, and changing the syntax to fit my personal tastes. This was overall very painless (except when i struggled for three days to implement the type checker)
  • The emitted lua code is not necessarily idiomatic, but fairly readable. It should play nice with jit heuristics.

Type system

A half-decent implementation of Hindley-Milner inference basically allows you to omit type annotations in most places while still getting all of the compile time guarantees. It also gets you generics for free.

I did not bother with subtyping, unions or flow-control based checking (ร  la mypy or typescript), since these are very hard to make watertight. It would not be too hard to add some implicit coercions where it makes sense.

TODOs

  • Standard library needs to be filled out
  • Some way to deal with optional types
  • I want to add a trait/typeclass system eventually
  • IDE integration, autoformatting etc

wulp's People

Contributors

sin-tel avatar sbdchd avatar

Stargazers

Casey Mulcahy avatar Hidde vb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.