Learn from Haskell - Functional, Reusable JavaScript

While many functional/haskell paradigms don’t translate, there are a few techniques that JS can benefit from.

2 notes

QUnit – A Powerful JavaScript Unit Testing framework

amtindia:

QUnit is a powerful, easy-to-use, JavaScript test suite. It’s used by the jQuery project to test its code and plugins but is capable of testing any generic JavaScript code (and even capable of testing JavaScript code on the server-side).

QUnit is especially useful for regression testing:…

1 note

Distributed OTP Applications | Learn You Some Erlang for Great Good!

Although Erlang leaves us with a lot of work to do, it still provided a few solutions. One of these is the concept of distributed OTP applications. Distributed OTP applications, or just distributed applications when in the context of OTP, allow to define takeover and failover mechanisms. We’ll see what that means, how that works, and write a little demo app to go with it.

18 notes

Shancat: Project Euler - Problem #1

shancat-dev:

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

I decided to approach this problem in a number of different languages.

Javascript

var sum = 0; for (i =...

16 notes

Shancat: Tail Call Optimisation

shancat-dev:

Consider the following function in Erlang that calculates the Nth Fibonacci number.

fib(0) -> 0; %% Base case 0.
fib(1) -> 1; %% Base case 1.
fib(N) when N > 0 -> fib(N - 1) + fib(N - 2).

Now notice how long running

fib(100).

takes.

Something important to understand is…

20 notes

Why Functional: One Reason

ingoschramm:

Why functional is better? So many reasons, one comes here: Programming languages are not made for computers, they are for humans to formulate generic solutions computers can solve faster in the details. The imperative style formulates the steps the computer has to follow, the functional style formulates the generic solution as such. Imperative style wants you to act like a machine, functional style allows you to think like a human.

Amen

Patterns For Large-Scale JavaScript Application Architecture

sambervalley:

Today we’re going to discuss an effective set of patterns for large-scale JavaScript application architecture. The material is based on Addy Osmani’s talk of the same name, last presented at LondonJS and inspired by previous work by Nicholas Zakas. Addy is currently a JavaScript and UI developer at AOL helping to plan and write the front-end architecture to AOL’s next generation of client-facing applications. As these applications are both complex and often require an architecture that is scalable and highly-reusable, it’s one of his responsibilities to ensure the patterns used to implement such applications are as sustainable as possible.

(Source: sambervalley)

3 notes

I like JS

suddently it happens a:

1 note

Creating a Query DSL Using Clojure and MongoDB

nosql:

Christopher Maier:

Not only does creating a DSL make querying easy (particularly with complex conditions), but it also insulates your application from change in a few important ways. Especially in the initial, exploratory stages of a project, it is common to change and evolve a data schema, and NoSQL environments make this very simple. Using a DSL will shield your code from these changes; you only need to change the DSL “atoms” that the schema change affects.

In case you missed it, Foursquare open sourced they type-safe Scala DSL for MongoDB.

Original title and link: Creating a Query DSL Using Clojure and MongoDB (NoSQL database©myNoSQL)

super cool!

2 notes

Cloudshift.cl: Clojurescript

cloudshift1:

Compiles to Javascript, has support for Nodejs.

I learned lisp and functional programming on Clojure a couple of years ago, but I’m not keen on the JVM, particularly the memory consumption, so I dropped it, and reverted to haXe, targetting Js and nodejs with my type sigs; coding in a…

(via cloudshift1)

4 notes

Johan Steenkamp: JavaScript Resources

steenkamp:

Why JavaScript? It’s fun, the most widely deployed programming language, and many other reasons.

If you are new to programming and JavaScript try Eloquent JavaScript by Marijn Haverbeke.

If you have done some programming my favorite JavaScript book to recommend is Object-Oriented…

cool link collection!

6 notes

try haskell in your browser

it’s haskell in your browser!

(Source: letits)

5 notes