Giter Club home page Giter Club logo

gleam's People

Contributors

abs0luty avatar acepie avatar ascandone avatar bcpeinhardt avatar brettkolodny avatar crowdhailer avatar dependabot[bot] avatar giacomocavalieri avatar harryet avatar inoas avatar itsgreggreg avatar johnbjrk avatar johndoneth avatar lpil avatar lucasavila00 avatar lunarmagpie avatar massivefermion avatar maxdeviant avatar michaeljones avatar michallepicki avatar mrgleam avatar nthtensor avatar quinnwilton avatar scripttease avatar thehabbos007 avatar tomwhatmore avatar tranzystorekk avatar tristancacqueray avatar vstreame avatar wesleimp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gleam's Issues

Remove module header syntax

Current syntax:

module Calculator
  exposing add/2, sub/2, div/2, mult/2

fn add(a, b) {
  a + b
}

fn sub(a, b) {
  a - b
}

fn div(a, b) {
  a / b
}

fn mult(a, b) {
  a * b
}

Proposed syntax:

pub fn add(a, b) {
  a + b
}

pub fn sub(a, b) {
  a - b
}

pub fn div(a, b) {
  a / b
}

pub fn mult(a, b) {
  a * b
}

Advantages

  • Removing the module header removes duplication between filename and source, making renaming easier and removing potential typos
  • Removing the export list removes duplication of name/arity between the list and the function definitions, making renaming easier and removing potential typos
  • Slightly more concise
  • May be more familiar to mainstream language users

Disadvantages

  • Slight increase in noise for public function definitions
  • Public interface of a module is less clear
  • Less familiar to Erlang and ML users

Type annotations

All are optional

fn id(x: Int) -> Int {
  x
}
  • Parsing
  • Module fn args
  • Module fn return
  • Anon fn args

Pipe operator

1 |> run

Parsing and typing is done, but the code generator is currently incorrect.

Explore implicit params

After reading about the OCaml implicit module PR I've had the idea for a system of implicit parameters bouncing round my head, giving Gleam a way of producing polymorphic functions such as enum:map which could operate on more than 1 type of data structure with less boilerplate.

Now it seems Scala has a very similar system already! A good place to start research.

https://docs.scala-lang.org/tour/implicit-parameters.html

https://docs.scala-lang.org/tutorials/FAQ/finding-implicits.html

https://discuss.ocaml.org/t/critique-of-implicits/3031/59

Code formatter

gleam format path/to/file.gleam

Reuse the pretty printing algebra used for Erlang code generation. Effectively it's a new compiler backend that skips type inference and compiles to Gleam.

Retaining comments

Strip the comments out, parse the remaining AST, traverse the AST and use positions in the AST and the comments to determine where to annotate which nodes with which comments.

Custom lalrpop tokenizer:

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.