Giter Site home page Giter Site logo

kal's People

Contributors

baldawar avatar grncdr avatar mrshu avatar rzimmerman 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

kal's Issues

better error handlers

possibly:

  • on error resume next
  • on error resume function
  • something on a per-line basis

Coffee-style functions can't be the first argument to a function call

Example of failure:

http = require 'http'
server = http.createServer (req, res) ->
  res.writeHead 200, {'Content-Type': 'text/plain'}
  res.end 'Hello Worlds\n'
server.listen(3000,'127.0.0.1')

It does work with explicit parentheses:

http = require 'http'
server = http.createServer((req, res) ->
  res.writeHead 200, {'Content-Type': 'text/plain'}
  res.end 'Hello Worlds\n'
)
server.listen(3000,'127.0.0.1')

more autoparen issues

This doesn't work without the parentheses:

returnValue = Kal.eval("_=(#{code}\n)", {filename: 'repl', modulename: 'repl'})

List expressions have issues with auto-parentheses

This code would not compile:

describe 'List Comprehensions', ->
  it 'should support for expressions inside list definitions', ->
   a = [1,2,3,4]
    b = [x+1 for x in a]
    a.should.eql [1,2,3,4]
    b.should.eql [2,3,4,5]

Where this would

describe 'List Comprehensions', ->
  it 'should support for expressions inside list definitions', ->
   a = [1,2,3,4]
    b = [x+1 for x in a]
    a.should.eql([1,2,3,4])
    b.should.eql([2,3,4,5])

inner assignment

allow things like:

[a,b] = somefunction()
{x,y} = require 'thing_with_x_and_y'

simplified callback syntax

Something like:

name = "Steve"
db.findByName name yields user
console.log user.id

Instead of:

name = "Steve"
db.findByName name, (err, user) ->
  return err if err
  console.log user.id

auto-parentheses don't work for some arguments

Parentheses don't get added to implicit function calls in the following cases:

The first argument is a regular expression

a.b /rex/g

The function object being called is the result of an array access

a.b[4] c

add support for validators

Syntax TBD, but something like:

Number a
a = 5 #ok
a = 'c' #throws error
Object a = 'c' #ok
if 5 is a Number #true
Positive Number x = -2 #throws

try/catch blocks don't wrap wait for statements in some cases

It appears to be an issue only with branching wait fors:

http = require 'http'
fs = require 'fs'

server = http.createServer((req, res) ->
  res.writeHead 200, {'Content-Type': 'text/plain'}
  try
    if req.url is '/javascript'
      wait for data from fs.readFile '/Users/Rob/test.js'
    else if req.url is '/kal'
      wait for data from fs.readFile '/Users/Rob/test.kal'
    else if req.url is '/error'
      wait for data from fs.readFile '/User/Rob/doesnotexist'
    else
      data = 'No Data...'
    res.end data
  catch e
    console.log e
    res.end "Error: #{e}"
)
server.listen(3000,'127.0.0.1')

Try calling this server with the /error path. It does detect the error but the try block doesn't seem to cover it.

instanceof issues

some issues observed with instanceof, which is currently not well supported. For example:

return x if a instanceof b 

better error reporting

Many errors are not descriptive and frequently, the compiler just puts out 'expected EOF on line 1' on errors. Also, it would be nice to print the stack trace in some reasonable way.

implement "not in"

Should be able to do this:

a not in b

In addition to the current construct:

not (a in b)

reserved words as properties have issues

This code will not compile:

process.on 'error', handleError

and requires parenthesis since the sugar module ignores reserved words like on when applying parentheses

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.