Coder Social home page Coder Social logo

jack's Introduction

Jack

Jack is a new language designed by Tim Caswell with the explicit goal of being easy to explain the semantics while still being powerful.

Jack is a scripting language aimed at kids learning to program as well as professionals who yearn for a simpler language (like me).

Language Features

  • Immutable unicode strings
  • Mutable Binary buffers (fixed length)
  • Booleans
  • Null
  • Integers
  • Floating Point Numbers
  • First class and higher-order functions.
    • Lexical closure.
  • Basic key/value maps for objects (no inheritance or prototype chain)
  • Dense Arrays
  • Everything is an expression where possible.
  • Implicit return values
  • Unified looping syntax that works on objects, arrays, and generator functions
  • Object metamethods for advanced usage (get, set, keys, length, call)
    • Allows objects to act like functions, arrays, etc.

My guiding principle while adding language features and semantics is:

Keep it Simple, Keep it Safe

See the examples folder for syntax examples.

jack's People

Contributors

creationix avatar

Stargazers

Givi Tsvariani avatar Shaik Ikbhal Basha avatar Jeen Mathew avatar Hady Mahmoud avatar ♫♨  ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎ avatar Rohman HM avatar Alexander Myshov avatar Army avatar Mateus Vahl avatar Max Pleaner avatar nicknak avatar  avatar Angus H. avatar Michael Konviser avatar  avatar Richard Maierhofer avatar POde - Olivier Scherrer avatar Steven avatar Jānis avatar Jock Murphy avatar Alexis Purslane avatar Marcus Stade avatar Nikos Tzanos avatar Pedro M. Silva avatar Adam K Dean avatar Tim De Pauw avatar Arief Bayu Purwanto avatar  avatar C Dorn avatar Terin Stock avatar juno suárez avatar Wojciech Miłkowski avatar Tom avatar Fernando Via Canel avatar Andrey Sidorov avatar Peter Johnson avatar Jan Vajda Attorney at Law Namestovo, Slovakia, Europe avatar mishrash avatar Fabien Bourgeois avatar Tak Tran avatar Matthew Elder avatar Nik Khilnani avatar Daniel Straight avatar Federico Corrado Ghedina Crepo avatar Cem Simsek avatar Brad Pillow avatar Nate Ferrero avatar Matt Thompson avatar Blake Bourque avatar Jacob Evans avatar Eran avatar  avatar Zack Corr avatar Thomas Frost avatar Ju avatar 题叶 avatar Marshall Culpepper avatar Maksim Lin avatar Nazeeruddin Ikram avatar Tom Coquereau avatar 代码之力 avatar Li Song avatar Esen Sagynov avatar  avatar Ahmed Aboshanab avatar Amit Kumar Das avatar Alba Mendez avatar Marco Pantaleoni avatar Andrea Campi avatar Mike Thornton avatar Joohun, Maeng avatar Brian T. Rice avatar Aghyad Saleh avatar davidcstevens avatar Matthew J. Sorenson avatar James Kleinschnitz avatar Adam Argyle avatar Nick Porcino avatar Márk Bartos avatar Dejan Duracoski avatar Vic Goldfeld avatar Erik Kastner avatar Jonathan Dahan avatar Benjamin Lupton avatar Simon Last avatar Elisée Maurer avatar ⓕⓣ avatar Rupak Ganguly avatar Jon Schoning avatar Anselmo Silva avatar Kohei Hasegawa avatar Sean Linsley avatar Niklas avatar Conrad Zimmerman avatar Starbuck Starfish avatar Voltron avatar heapwolf avatar Matt Field avatar Kevin O'Hara avatar Alejandro Morales avatar

Watchers

Anselmo Silva avatar Four on Github avatar Nikos Tzanos avatar  avatar  avatar Will Conant avatar tom zhou avatar Fernando Via Canel avatar Nick Porcino avatar  avatar Jeff avatar Matt Thompson avatar James Cloos avatar  avatar Jānis avatar Carlos Arturo Quiroga Quiroga avatar Army avatar  avatar Jeen Mathew avatar

jack's Issues

Explanation

Could you write an explanation on how to use this really cool language? :)

Subjective feedback on current languge design

  • String - Both clojure and haskell treat strings as sequence / list of characters, find that
    particular feature super powerful. Lets you work with different underlying types with a
    same abstractions. In fact lots of functions written for just lists are super useful for strings
    to, in fact clojure takes this even further and let's you treat anything as sequence and if
    value is singular then it's sequence of itself.

  • Buffer - Similar as above, although clojure does not has a standard buffer construct
    they just relay on java types for that. Haskell has something similar though in form of
    bytestrings

  • Symbols - It would be useful to have comparison with symbols say in lisp / scheme. Also I think it would be better to have just
    a list of values that act as false in logical operations like: false, nil.

  • Builtin / Program form - I think leveraging pre-existing terminology and syntax would
    benefit the project. Usually I believe it's being referred as "read form" and result of read is
    just a list of symbols, lists, and other primitive data types. In clojure It could be also
    vectors (which are basically arrays), maps, sets and keywords. It also feels like you
    encoded form is very similar to lisp program not sure why not just use same syntax and
    take benefit of tooling peoples familiarity etc..

    (sum
     (mul a 2)
     (div 2 3))

    It's even lighter or maybe it just feels so because of lisp ? BTW why not just allow
    symbols arithmetic chars in symbols. That's what lisps do and define special forms
    like sum, mul, div using those:

    (+ (* a 2) (/ 2 3))
  • blocks - Blocks are very similar to s-expressions and a thing that I miss a lot
    in all the other languages. In fact every list in lisp is an s-expression and there for
    evaluation of it has a value. It's super powerful IMO one of the key reasons why
    macros in lisp are so powerful but simple (although not everyone agrees on this).

  • I don't quite understand reasons for making scope part of function form. I think it's
    confusing since translation from source to AST and back won't be obvious. Maby
    you're looking for something like let special form ?

  • list Lists and aliases feel like data structure mixeup lists are known for linear time
    lookup in the tail position, but document here I believe assumes constant time instead.
    Also not quite sure aliases are needed, why not functions ? It feels like alias is just
    a function that captures list and index of item it's aliased to. I'm getting an impression
    that lists here try to act as lists, arrays and maps at the same time which I'm not convinced
    is such a good idea. clojure for instance treats all of them as sequences while still have
    clear pros & cons per data structure. I think I prefer that approach instead.

Other

Not sure how function calls are experessed, in lisps calls are expressed by
putting fn in the head of the list. If symbol in the head is a special form (if,
fn) it's just interpreted. Also note that first form may be a macro symbol. Although
at compile time read form is traversed and all macro forms are expanded by associated
macros. In way macros act like functions that are run during compilation and are handed
a tail of the list who's head was a symbol associated with a executed macro. That way
these macro can do any kind of transformations on the handed list and return back
another list if returned list still contains macro forms it's expanded again and again, until
form reaches a state where all the head symbols are either special forms or names of
functions to be called. I'm shifting a little into macro discussion here, but I suspect that
desire of homoiconicity was related. Lot of other special things like .apply in js can be
then trivially expressed as macros

I would really advice taking time to watch these two videos, Rich Hickey goes through and
explains language forms, type and how reader evaluator works. I think a lot of it really relevant:
http://www.youtube.com/watch?v=ketJlzX-254
http://www.youtube.com/watch?v=sp2Zv7KFQQ0

All in all I do think that starting with a very minimalistic subset of lisp / scheme / clojure syntax would be better, since it's not too different but have being time tested + lot's of
tooling and knowledge has being accumulated over the years.

Part of me also wished it data structures were immutable by default. I really love how
powerful and natural it could be with a right language integration (clojure is an example
that comes in mind). I definitely see reasons for mutations, but making that a second
class makes a lot of difference.

Allow inline define and assign variables

Currently, you have to define local variables using the vars keyword.

vars a, b
a = 1
b = 2

After this change, you will be able to do it in a single line

let a = 1
let b = 2

The variable is defined from that point onward. If you try to access it before it's defined, it will not be defined. This should be a static error when compiling.

Generate a Big Picture through General Project Questions

Whenever I have a new project, I find communicating the big vision important to engage other people. I thought I would ask questions from an outside perspective, and you/we could develop the answer. This would help myself and others understand the project.

  1. What need is jack trying to fulfil? i.e. what is one use-case where jack would be deployed.
  2. Without any IO, how does jack do anything?
  3. Why not module system?
  4. Is the language object-oriented?
  5. Will there be functional-programming constructs? i.e. first-class functions, higher-order functions?
  6. What language constructs did you add that are missing from Javascript?

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.