Angel \”Java\” Lopez on Blog

May 11, 2013

Express: Links, News And Resources (3)

Filed under: Express, JavaScript, Links, NodeJs, Web Development — ajlopez @ 10:45 am

Previous Post

A third entry with links about Express, the “standard” Node.js web framework.

Simple Screenshot
https://github.com/visionmedia/screenshot-app
simple screenshot application & web service powered by Express, Redis, node-canvas, palette, and PhantomJS.

Khelldar/Angular-Express-Train-Seed · GitHub
https://github.com/Khelldar/Angular-Express-Train-Seed
A starting point for making an AngularJS app with node.js on the back end, using the Express Train framework

Modular web applications with Node.js and Express on Vimeo
http://vimeo.com/56166857
This short screencast describes how you can use Express’ app mounting feature to create modular self-contained applications to construct your product.
By @tjholowaychuk, Express author

node-money – Cloud9
https://c9.io/renatoargh/node-money
Sample app with access control

Structuring a node.js web application with Express | Gama & Ferraz
http://zeppelin-ci.org/structuring-a-node-js-web-application-with-express/
Explain node-money example

thinkphp/express-basic · GitHub
https://github.com/thinkphp/express-basic
A simple Website on Node.js with Express, Jade and Stylus deploying on Heroku

jesusabdullah/node-ecstatic · GitHub
https://github.com/jesusabdullah/node-ecstatic
A simple static file server middleware that works with both Express and Flatiron

node-home-automation – Node.js based home automation server application – Google Project Hosting
http://code.google.com/p/node-home-automation/

astalker/nblog · GitHub
https://github.com/astalker/nblog
A Simple CMS module for Node Js using Express, EJS and Mongo

genem
https://github.com/madhums/node-genem
A MVC generator for node.js (uses express, mongoose, jade and passport.js)

How an Event Loop works « Matt’s Hacking Blog
http://baudehlo.wordpress.com/2013/02/14/how-an-event-loop-works/

Cross-domain AJAX, Express.js and Access-Control-Allow-Origin – /var/blog – John Roepke – Boston Area Web and Open Source Software Developer
http://john.sh/blog/2011/6/30/cross-domain-ajax-expressjs-and-access-control-allow-origin.html

anddimario/mucontent · GitHub
https://github.com/anddimario/mucontent
MuContent – CMS based on ExpressJs for create multisite, multilanguage and modular web application with Node.Js

mdalpi/battleship-node · GitHub
https://github.com/mdalpi/battleship-node
Battleship Game with chat support written in Node.JS

smurthas/gdata-js · GitHub
https://github.com/smurthas/gdata-js
Simple Google Data API client for OAuth 2.0

agrueneberg/Corser · GitHub
https://github.com/agrueneberg/Corser
A highly configurable, middleware compatible implementation of CORS for Node.js.

express.js middleware to support CORS pre-flight requests
https://gist.github.com/2344435

jawerty/Node2Blog · GitHub
https://github.com/jawerty/node2blog
A simple and easy to setup node.js blog template. For the casual blogger

http – Extracting POST data with Express – Stack Overflow
http://stackoverflow.com/questions/11002046/extracting-post-data-with-express/14125262#14125262

express.io – realtime-web framework for nodejs
http://express-io.org/

My Links
http://delicious.com/ajlopez/express

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

May 3, 2013

New Month’s Resolutions: May 2013

Filed under: NodeJs, Open Source Projects — ajlopez @ 4:18 pm

Review of my April’s resolutions:

- Update Mass [complete] see repo
- Start NodeAima [complete] see repo
- Give a one-day course on Node.js [complete]
- Update AjGenesis [pending]
- Update AjGenesisRuby [pending]
- Update SimpleGo [pending]
- Update RubySharp [complete] see repo 
- Update ClojSharp [pending]

Additionally, I worked on:

- Update AjFabriqNode [complete] see repo
- Update NodeSamples [complete] see repo (see Distributed Fractal)
- Update SimpleStorm [complete] see repo
- Update SimpleBus [complete] see repo
- Update SimpleBroadcast [complete] see repo
- Update SimpleGA [complete] see repo

All this work is related to a talk I gave one week ago, about Distributed Applications and Node.js

May’s resolutions:

- Update Mass
- Update RubySharp
- Give a talk, Intro to Ruby
- Update AjGenesis
- Update ClojSharp
- New posts about Mass
- New posts about Distributed Applications and Node.js

More fun and work.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

February 22, 2013

Node.Js: Links, News And Resources (15)

Filed under: JavaScript, Links, NodeJs — ajlopez @ 9:33 am

Previous Post

Connect Roles
http://documentup.com/ForbesLindesay/connect-roles
Connect roles is designed to work with connect or express. It is an authorization provider, not an authentication provider. It is designed to support context sensitive roles/abilities, through the use of middleware style authentication strategies.

Rob Conery – Real World NodeJS – Creating the Tekpub API
http://vimeo.com/43548699
NodeJS is The New Thing and it also happens to be a lot of fun and quite capable. In this talk Rob will take you from 0 to production using NodeJS, the NPM package management system, MongoDB, ExpressJS, and a handful of other NodeJS modules. You’ll see various ways to structure your application using plain Javascript here, some CoffeeScript there and get an overall sense of what NodeJS can do, and why you should care.

substack / bouncy
https://github.com/substack/bouncy
bounce HTTP requests around for load balancing or as an HTTP host router
Bouncy uses node’s http parser innards to bounce http requests around to where they need to go in an entirely transparent way.

Making statsd talk directly to a browser
http://swizec.com/blog/making-statsd-talk-directly-to-a-browser/swizec/4649
StatsD is “A network daemon that runs on the Node.js platform and listens for statistics, like counters and timers, sent over UDP and sends aggregates to one or more pluggable backend services”

Felix’s Node.js Convincing the boss guide
http://nodeguide.com/convincing_the_boss.html
Now that you’re all hyped up about using node.js, it’s time to convince your boss. Well, maybe. I have had the pleasure of consulting for different businesses on whether node.js is the right technology, and sometimes the answer is simply no.
So this guide is my opinionated collection of advice for those of you that want to explore whether node.js makes sense for their business, and if so, how to convince the management.

dominictarr / badass
https://github.com/dominictarr/badass
The proxy that breaks all the rules and doesn’t ever care

Does drupal or joomla allow a combination node.js and socket.io with php?
http://stackoverflow.com/questions/10712648/does-drupal-or-joomla-allow-a-combination-node-js-and-socket-io-with-php

Drupal: Node.js
http://groups.drupal.org/node-js
http://drupal.org/project/nodejs

How to structure communication between Nodejs server and rails?
http://stackoverflow.com/questions/9352786/how-to-structure-communication-between-nodejs-server-and-rails

LearnBoost / up
https://github.com/learnboost/up
Zero-downtime reloads and requests load balancer based on distribute

Staying up with Node.JS
http://www.devthought.com/2012/01/29/staying-up-with-node-js/

Do I have to reload app.js every time I make a small change?
http://stackoverflow.com/questions/3336481/do-i-have-to-reload-app-js-every-time-i-make-a-small-change

kuchumovn / node-js-development-mode
https://github.com/kuchumovn/node-js-development-mode
Auto reload Node.js when modifying application code (hot reload, "development mode")

A fresh work enviroment for Node.js and Express on Ubuntu 10 in about 30 minutes
http://fabianosoriani.wordpress.com/2011/08/01/a-fresh-work-enviroment-for-node-js-and-express-on-ubuntu-10-in-about-30-minutes/

isaacs / node-supervisor
https://github.com/isaacs/node-supervisor
A little supervisor script for nodejs. It runs your program, and watches for code changes, so you can have hot-code reloading-ish behavior, without worrying about memory leaks and making sure you clean up all the inter-module references, and without a whole new require system.

The Node.JS MongoDB Driver Manual
http://mongodb.github.com/node-mongodb-native/

mjrusso / livestreaming-js
https://github.com/mjrusso/livestreaming-js
HTTP Live Streaming, for node.js
A complete system for producing and serving content conforming to the HTTP Live Streaming specification, built on Node.

meloncholy / vid-streamer
https://github.com/meloncholy/vid-streamer
VidStreamer.js: A simple streamer for Flash and other videos (and other files too). Supports HTTP pseudostreaming and works with JW Player’s bitrate switching.

orospakr / stream-pump
https://github.com/orospakr/stream-pump/
HTTP live video stream reflector written in Node.js (currently only for Microsoft MMSH video streams)

The love and hate of Node.js
http://mailinator.blogspot.se/2012/05/love-and-hate-of-nodejs.html?m=1

JSConfAr 2012 Videos
http://blip.tv/jsconfar

express / examples
https://github.com/visionmedia/express/tree/master/examples

Node.js API changes between v0.6 and v0.8
https://github.com/joyent/node/wiki/API-changes-between-v0.6-and-v0.8

Worlize / WebSocket-Node
https://github.com/Worlize/WebSocket-Node
A WebSocket Implementation for Node.JS (Draft -08 through the final RFC 6455)

Implementing Web Socket servers with Node.js
http://laktek.com/2010/05/04/implementing-web-socket-servers-with-node-js/

Introducing the Microsoft Driver for Node.JS for SQL Server
http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx

Windows Azure just got a lot friendlier to node.js developers
http://codebetter.com/glennblock/2012/06/07/windowsazure-just-got-a-lot-friendlier-to-node-js-developers/

Examples in using RedisStore in socket.io
http://stackoverflow.com/questions/9267292/examples-in-using-redisstore-in-socket-io

RedisStore and rooms with Socket.IO
http://www.ranu.com.ar/search/label/socket.io

Control Flow
https://docs.google.com/presentation/d/1m637uaMMTWTziB4clokP5cPsAN0OFxDUWEQXFz6YsLw/edit#slide=id.p
In Javascript. Love it. Hate it. Learn about it.

Lazyshot / storm-node
https://github.com/Lazyshot/storm-node
Storm Multilang support with Node.JS

epokmedia / storm-node-multilang
https://github.com/epokmedia/storm-node-multilang
Multilang implementation in node.js for the Storm distributed realtime computation system

Nodeclipse
http://www.nodeclipse.org/
Nodeclipse is an plugin that adds IDE functionality to the Eclipse for the Node.
The purpose of Nodeclipse is to create an environment in which development of Node is easy for a beginner to intermediate user.

Socket.IO: CPU 100% with Redis Store
https://github.com/LearnBoost/socket.io/issues/862

My Links
http://delicious.com/ajlopez/nodejs

February 2, 2013

New Month’s Resolutions: February 2013

Filed under: C Sharp, JavaScript, NodeJs, Open Source Projects — ajlopez @ 3:07 pm

Time to review my January Resolutions:

- Start SimpleScript [complete] see repo
- Start SimpleBoard [complete] see repo
- Start SimpleChess [complete] see repo
- Start SimpleGo [complete] see repo
- Start and publish a version of SimpleMapReduce, with local and distributed sample [partial] see repo (only local version)
- Start and publish a version of SimpleFunc, object with functions serialization [complete] see repo
- Start Memolap, C# in-memory multidimensional OLAP-like library and sample [partial] see repo (sample WIP)
- Start SimpleMemolap, the same but in JavaScript/Node.js [complete] see repo
- Start SimpleRules, forward-chaining rule engine, that compiles to JavaScript [complete] see repo

Additionally, I was working on:

- Update AjConsorSite [complete] see repo
- Update Inmob [complete] see repo
- Start SimpleKeeper, Zookeeper-like server [complete] see repo
- Start and publish first version MultiNodes [complete] see repo
- Update SimpleStorm, publish new version using SimpleQueue 0.0.2 [complete] see repo
- Update SimpleQueue publish new version [complete] see repo
- Update SimpleRemote publish new version using SimpleMessages 0.0.3, and async methods [complete] see repo
- Publish first version AjFabriqNode [complete] see repo
- Start and publish first version NodeDelicious [complete] see repo
- Refactor SimpleBroadcast to use SimpleMessages 0.0.3 [complete] see repo
- Publish new version SimpleMessages 0.0.3 [complete] see repo
- Start and publish first version MProc, middleware layer for message processing Node.js, [complete] see repo
- Start and publish first version SimpleTags, engine to manage items with arbitrary data and tags [complete] see repo
- Start and publish first version ObjectStream, bidirectional and unidirectional object streams for Node.js [complete] see repo
- Start and publish first version SimplePipes, yet another flow library in Node.js [complete] see repo
- Start and publish first version SimpleSudoku, sudoku solver in JavaScript/Node.js [complete] see repo
- Start and publish first version SimplePermissions, permissions by Subject, Role, and Context. Model in-memory [complete] see repo
- Start and publish first version SimpleGlobals, inspired by Mumps Globals [complete] see repo
- Start and publish first version SimpleInvoke, chained invocation of functions with callbacks, JavaScript/NodeJs [complete] see repo

For this new month:

- Start SimpleDatabase
- Update SimplePermissions
- Update SimpleStorm (implements ack, maybe integrate with MultiNodes)
- Update SimpleMapReduce
- Update SimpleKeeper, leader, distributed example
- Update AjFabriqNode, integrate with new SimpleMessages, maybe with MultiNodes
- Update MultiNodes
- Update AjGenesisNode, to use global commands and tasks

I will give a seminar (full day) of Node.js at Rosario, Argentina

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

January 25, 2013

SimpleTags (1) First Ideas

Filed under: JavaScript, NodeJs, Programming, SimpleTags — ajlopez @ 4:52 pm

More than a decade ago, I wrote the basis of my personal site, based on having heterogeneous items (links, pages, etc..) classified into categories (a tree of categories). An item could be into more than one category, and one category could be an alias for another. But after using Delicious and Gmail, now I prefer to have items grouped by tags. And instead of having categories and category tree (like folders), I think that a more flexible organization could be based on predicates over tags: that is, instead of having a Category Programming –> C#, I could have a predicate that returns all items tagged with “programming” and “c#”. Sometimes, I need key-value tags, like “author:unclebob”, or “project:storm”.

So, some days ago, I started a new project, written in JavaScript/Node.js, named SimpleTags:

https://github.com/ajlopez/SimpleTags

From the readme:

var itemId = engine.createItem('http://nodejs.org', [ 'nodejs', 'javascript', 'engine', 'programming' ]);

An item has

  • data: Arbitrary value you supplied
  • tags: An array of tags. A tag could be a non-empty string or an object with only one property with non-empty value.

Once created, the item has an associated id, supplied by the engine.

The project has an in-memory model. A set of tags can be associated to an arbitrary data item. Usually, you don’t associate all customer data to a set of tags; instead, you could associate a customer id. The arbitrary data could reside in your database or it could an URL, or something else. The key feature is: you can associate an item to a set of tags, and retrieve items with given tags.

Think about this: you could have a huge link collection, and use SimpleTags to organize it. Or documents, instead of links. Or photos/images. You could use tagging for different purpose. It’s a powerful idea to be applied in many domains and scenarios.

I think to add a web site as a concrete use case, where you can add URLs and tag them, define “Categories” using tag predicates, explore the defined categories, and search items by tags. After this sample, I could implement something more concrete, like a tagged to-do list, or a list of tasks tagged by project, status (pending, closed, …), iteration, assignee, etc. I used a similar private app for tracking agile project backlog in one of my customers, and I feel it’s a good test bed case to be tackled by my tag engine project.

It could be used as an excuse to learn Express or to use my SimpleWeb project. In any case, it will be fun :-)

As usual, SimpleTags code was written using TDD.

Keep tuned!

Angel “Java” Lopez

http://www.ajlopez.com

http://twitter.com/ajlopez

January 19, 2013

CobolScript (4) Web Pages with Templates

Filed under: COBOL, CobolScript, JavaScript, NodeJs, Open Source Projects — ajlopez @ 3:47 pm

Previous Post

In the previous post I presented CobolScript generating output using templates. It can be used to generate web page output, too. The sample is at:

https://github.com/ajlopez/CobolScript/tree/master/samples/templateweb

The launch program in JavaScript is simple:

var cobs = require('../..'),
    http = require('http'),
    fs = require('fs');

var program = cobs.compileTemplateFile('./factorial.cobp');

http.createServer(function(req, res) {
    program.run(cobs.getRuntime({ request: req, response: res }));
}).listen(8000);

console.log('Server started, listening at port 8000');

The key part is the call to compile the file template. It produce a compiled JavaScript function to be invoked. The call of program.run executes the template, with a giving runtime context. The runtime context is build giving the request and response objects of the current incoming request. That runtime derives all the output of the CobolScript program to the response output. So, the template doesn’t know about web request and response. You can see the runtime object as a service provider to the compiled CobolScript program. Its properties can be accessed if you define a LINKAGE SECTION as in classic COBOL. But this feature was not used in this simple sample.

The template file

<h1>Factorial</h1>
<p>Page generated by CobolScript, using templates</p>
<table>
<tr><th align='right'>n</th><th align='right'>n!
</th>
</tr>
<#
local n.
perform show-factorial using n varying n from 1 to 10.
#>
</table>
<#
.
stop run.

show-factorial section using n.
local result.
perform factorial using n giving result.
#>
<tr>
<td align='right'>${n}</td><td align='right'>${result}
</td>
</tr>
<#
.

factorial section using n.
local m.
if n = 1 then return n.
subtract 1 from n giving m.
perform factorial using m giving m.
multiply n by m.
return m.
#>

Launch the server with

node server

Navigate to localhost:8000, the result:

Next post: a dynamic web site accessing MySQL database, using CobolScript.

Keep tuned!

Angel “Java” Lopez

http://www.ajlopez.com

http://twitter.com/ajlopez

January 16, 2013

Some projects with in-memory model

Filed under: JavaScript, NodeJs, Open Source Projects — ajlopez @ 5:05 pm

I’m a big proponent of having models (domain models) residing in memory. Of course, in the appropriate context. There are many problems that could have a better solution if we forgot the “use the database, Luke” approach. One notable solution/project is Redis, that using a single thread implements a complete and powerful key-value store in memory, with options for persistence and clustering (redis cluster still under development).

I’m playing implementing personal projects using an in-memory model. There are:

SimpleMemolap: Multidimensional OLAP-like model, in JavaScript/Node.js with a web sample.

Memolap: Multidimensional OLAP-like model, in C#. Web sample in progress.

SimplePermissions: Subjects, Roles, Permissions, Contexts, all in memory.

AjKeyvs: Redis-like in-memory key-value store, in C#. I should add the client protocol. I should review the internal algorithms, but all was coded using TDD, ready for refactors.

SimpleStore: Simple Key Value Store in memory, a la Redis, JavaScript/Node.js. In process or exposed to remote clients using additional modules. Work in Progress.

SimpleQueue: in-memory queue implementation, JavaScript/Node.js. It could be used in process or acceded via exposing the methods to remote calls.

SimpleTags: having items with arbitrary data, tagged with strings or key-value objects.

Maybe I could add SimpleRules: rule engine where the facts reside in-memory (many rule engines use directly the memory to represent the world state).

And even I could mention: SimpleBoggle, where the list of words to resolve a Boggle game it’s loaded in memory ;-)

To be started:

SimpleDatabase: in-memory database, with SQL-like query language, JavaScript/Node.js

Most of these projects could be extended to have pluggable persistence. But now I’m interested in having something that works to play with. I’m having fun implementing internal algorithms, trees, search, inverted indexes, etc. And practicing TDD every day.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

January 12, 2013

Code Katas in JavaScript/Node.js using TDD

These past weeks, I was working in JavaScript/Node.js modules, using TDD at each step. Practice, practice, practice, the journey to mastery.

You can see my progress, reviewing the commits I did at each new test. This is a summary of that work:

CobolScript: See my posts, an implementation of COBOL as a compiler to JavaScript, having console program samples, dynamic web pages and access to Node.js modules. See web sample, using MySQL, and SimpleWeb.

SimplePipes: A way to define message-passing using ‘pipes’ to connect different defined nodes/functions. I want to extend it to have distributed process.

SimpleBoggle: Boggle solver, it is better than me! See console sample.

SimpleMemolap: Multidimensional OLAP-like processing, with in-memory model, and SimpleWeb site see sample:

SimpleChess: Work in progress, define a board using SimpleBoard, and make moves. I’m working on SimpleGo, too, to have a board, game, and evaluators.

SimpleRules: forward-chaing rule engine. I should add rule compilation to JavaScript. The engine works a la Rete-2, detecting the changes in the current state, and triggering actions.

SimpleScript: see post, my simple language, compiled to JavaScript. See posts. WIP.

Py2Script: Python language compiler to JavaScript, first step. WIP.

SimpleWeb: web middleware, a la Connect, with web sample.

BasicScript: My first steps to compile Basic to JavaScript. I want to use it to program and compile a game.

SimplePermissions: Today code kata. It implements subjects, roles, and permissions, granted by context.

SimpleFunc: Serialization of functions.

SimpleMapReduce: Exploring the implementation of a Map-Reduce algorithm.

SimpleTuring: Turing machine implentation.

Cellular: Cellular automata implementation, including a Game of Life console sample.

I will work on:

NodeDelicious: To retrieve my links from my Delicious account, now the site was revamped and no more pagination.

SimpleDatabase: In-memory database, maybe I will add file persistence.

SimpleSudoku: Rewrite of my AjSudoku solver, from scratch.

I’m having a lot of fun, as usual ;-)

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

January 6, 2013

New Month’s Resolutions: January 2013

The first month of a new year! I’m was busy coding a lot. It’s time to review past month resolutions:

- Work on PythonSharp [pending]
- Work on AjTalk for C# [complete] see repo and see my posts
- Give a Node.js course [complete] Spanish post
- Start .md pages Java tutorial [pending]

Additionally, I was working on:

- Start Py2Script Python to JavaScript compiler [complete] see repo
- Update my Node.js samples [complete] see repo
- Start and publish version 0.0.1 of SimpleWeb, my middleware layer [complete] see repo
- Start BasicScript [complete] see repo
- Start and publish version 0.0.1 of CobolScript [complete] see repo and see my posts
- Update AjConsorSite [complete] see repo
- Start Inmob [complete] see repo

For this new month, these are my new resolutions (some are already started):

- Start SimpleScript
- Start SimpleBoard
- Start SimpleChess
- Start SimpleGo
- Start and publish a version of SimpleMapReduce, with local and distributed sample
- Start and publish a version of SimpleFunc, object with functions serialization
- Start Memolap, C# in-memory multidimensional OLAP-like library and sample
- Start SimpleMemolap, the same but in JavaScript/Node.js
- Start SimpleRules, forward-chaining rule engine, that compiles to JavaScript

A lot of fun! ;-)

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

January 2, 2013

SimpleScript (1) First ideas

The latest two week, I was busy writing CobolScript, my COBOL compiler to JavaScript (see my posts). I have console sample programs, and dynamic pages samples running on Node.js (see samples). The web samples are using the simple http node.js module, or my new SimpleWeb module, a simple middleware layer a la Connect. I started to write a Python to JavaScript compiler, see Py2Script, too. But now, after those training projecs (my first ones that are compiling to JavaScript using JavaScript), I want to push the envelope and write a simple script compiler, I named SimpleScript (see repo).

The key points:

- It compiles to JavaScript, so, it’s JavaScript-oriented. It’s not a script language to be implemented in different technologies (.NET, Java, JavaScript). It’s totally oriented to JavaScript semantic.

- I love C programming language tradition, but this time, I want no semicolons and curly braces. I want a syntax more Python/Ruby oriented.

- No indentation “hell”. Ok, I like Python, but indentation as part of the syntax, it’s not my preferred way.

- No command separator (no semicolon or something else) except new line or syntax. That is, I could write

if a < 1 a = 1

or

if a < 1
   a = 1
end

Notice the use of end.

You CANNOT write (semicolon is not a separator):

if a < 1 a=1; b=2

You MUST write:

if a < 1
  a = 1
  b = 2
end

- No parenthesis around conditions (see the above if example).

- Only for … in , to be discussed. I want to have for-in as in JavaScript, but with some variant to access directly the values instead the names/indexes of an object or array. Something like

for k in myarray

iterates over myarray indexes.

for k in myarray values

iterates over myarray values, directly. Range expression will be supported:

for k in 0..n

- Loops with continue, break. The main loop construction is the while.

- Functions as first class citizens.

- function keyword will be used to define anonymous functions. Maybe (to be discussed) I will use define keyword to define named functions.

- Function invocation with explicit parenthesis (forget Ruby convention, go for something like Python 3.x).

- Array access with [] (forget Basic programming convention of using parenthesis).

- External variables. I learnt this from my CobolScript work: the linkage section is useful. An external variable is something injected at runtime (not a global one), and it can be provided in the call to the program. For example, print function could be an external one, so the calling program could redirect the print to the console, or to a buffer or to the web response. at will.

- Global variables should be declared explicitly. All non-declared variable is considered local (to the function, unit where it is used).

- Functions has closures as in JavaScript. In contrast, AFAIK, Python use explicit declaration to access outer variables in a function. I like JavaScript automatic access to outer variables, so I will keep it.

- Async constructions. I added this to CobolScript, and I found it useful. It’s something like the await/async in C# 5.0

- Run on the browser and on Node.js.

- Class support: to be discussed (the only key use case I have, is the game client coding for my game project).

I know, there are other implementations, like CofeeScript. But I want to training me, on JavaScript, Node.js and TDD.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

Older Posts »

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 28 other followers