Angel \”Java\” Lopez on Blog

May 20, 2012

May 5, 2012

Clojure: Links, News And Resources (6)

Filed under: Clojure, Links, Lisp, Programming Languages — ajlopez @ 4:47 pm

Previous Post

More links about Clojure:

Clojure and me » A poor man’s interval tree
http://clj-me.cgrand.net/2012/03/16/a-poor-mans-interval-tree/

C2: Clojure(Script) data visualization
http://keminglabs.com/c2/

cljs-template with Clojure/ClojureScript REPLs from Emacs
http://www.spyfoos.com/index.php/2012/03/17/cljs-template-with-clojureclojurescript-repls-from-emacs/

A Brief Beginner’s Guide To Clojure
http://www.unexpected-vortices.com/clojure/brief-beginners-guide/

A Core.logic Primer · clojure/core.logic Wiki
https://github.com/clojure/core.logic/wiki/A-Core.logic-Primer

takeoutweight/clojure-scheme
https://github.com/takeoutweight/clojure-scheme
Clojure to Scheme to C to the bare metal.

Clojure – splice and easy – sw1nn
http://sw1nn.com/blog/2012/03/12/clojure-splice-and-easy/

ibdknox/cljs-template
https://github.com/ibdknox/cljs-template
a lein-newnew template for clojurescript projects

halgari/clojure-py
https://github.com/halgari/clojure-py
Clojure in Python

[Clojure] Clojure list syntax sugar: f(x) notation – Grokbase
http://grokbase.com/t/gg/clojure/11ctt573jq/list-syntax-sugar-f-x-notation

quil/quil
https://github.com/quil/quil
(mix Processing Clojure)

Connect With Your Creation Through a Real-Time Editor
http://www.webmonkey.com/2012/03/connect-with-your-creation-through-a-real-time-editor/

fogus: Datomic
http://blog.fogus.me/2012/03/05/datomic/
Rich Hickey, Stuart Halloway, and others at Relevance, Inc. have announced Datomic — a new kind of database.

The Big Three – Scala, Clojure and Groovy | The Code General
http://thecodegeneral.wordpress.com/2012/03/04/the-big-three-jvm-languages/

Loading Data with Clojure | Brad Lucas | Beacon Hill
http://www.beaconhill.com/blog/?p=279

Implement A Dsl ←
http://www.clojure.net/2012/03/02/Implement-a-DSL/

VijayKiran.com – Web Application Development with Clojure – Part 1
http://www.vijaykiran.com/2012/01/11/web-application-development-with-clojure-part-1/

Dancing monkey gibbers on about macros and such…
http://blog.fogus.me/2012/02/20/dancing-monkey-gibbers-on-about-macros-and-such/

InfoQ: Clojure: Towards The Essence Of Programming
http://www.infoq.com/presentations/Clojure-Towards-The-Essence-Of-Programming

InfoQ: Event-Driven Programming in Clojure
http://www.infoq.com/presentations/Event-Driven-Programming-in-Clojure/

Overtone and ClojureScript
http://www.chris-granger.com/2012/02/20/overtone-and-clojurescript/

Sam Aaron: "Programming Music with Overtone" | Clojure on Blip
http://blip.tv/clojure/sam-aaron-programming-music-with-overtone-5970273

binomial coefficients « Clojure Companion Cube
http://clojure.roboloco.net/?tag=binomial-coefficients

Fusion Programming: From Python to Clojure and Back | cassiel
http://www.cassiel.com/2012/02/19/fusion-programming/

CodeLesson – Introduction To Clojure
http://codelesson.com/courses/view/introduction-to-clojure

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

Keep tuned!

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

April 10, 2012

Lisp: Links, News And Resources (2)

Filed under: AjLisp, Functional Programming, Links, Lisp, Programming Languages — ajlopez @ 1:23 pm

Previous Post

More links and resource about one my favorites programming languages:

My implementations
http://ajlopez.wordpress.com/category/ajlisp/
http://code.google.com/p/ajlisp/ in C#, three flavors (classic, scheme-like, clojure-like (WIP))
https://github.com/ajlopez/AjLispRb in Ruby
https://github.com/ajlopez/AjLispJs in JavaScript
https://github.com/ajlopez/AjLispJv in Java

Ruby talks to AutoLISP · davidbl/acadhelper Wiki
https://github.com/davidbl/acadhelper/wiki/Ruby-talks-to-AutoLISP

The Emacs Problem | Irreal
http://irreal.org/blog/?p=384

How Emacs changed my life
http://www.slideshare.net/yukihiro_matz/how-emacs-changed-my-life
By Yukihiro "Matz", Ruby creator

cl-dcf – Common Lisp DSL Compiler Framework – Google Project Hosting
http://code.google.com/p/cl-dcf/

Clojure inventor Hickey now aims for Android
http://www.techworld.com.au/article/419328/clojure_inventor_hickey_now_aims_android/?fp=16&fpid=1 In an interview, Clojure founder Rich Hickey discusses future of the functional JVM language, including his mobile aspirations

BiwaScheme Blackboard
http://blackboard.biwascheme.org/
BiwaScheme Blackboard is a sandbox for BiwaScheme, a R6RS Scheme interpreter written in JavaScript.
You can edit, run and save Scheme code in your browser.

Can Your Programming Language Do This? – Joel on Software
http://www.joelonsoftware.com/items/2006/08/01.html
…Without understanding functional programming, you can’t invent MapReduce, the algorithm that makes Google so massively scalable. The terms Map and Reduce come from Lisp and functional programming. …

mtravers / heroku-cl-example
https://github.com/mtravers/heroku-cl-example
Example use of Heroku Common Lisp Buildpack

AI Algorithms, Data Structures, and Idioms in Prolog, Lisp, and Java
http://www.amazon.com/dp/0136070477

Calico Scheme – IPRE Wiki
http://calicoproject.org/Calico_Scheme
Calico Scheme is a new implementation of a Scheme-based language for Calico. It implements many core Scheme functions, but also adds some functionality to bring it into line with the other modern languages like Python and Ruby.

Multics Emacs History/Design/Implementation
http://www.multicians.org/mepap.html

Lisp REPL in Vendetta Online
http://www.a1k0n.net/2005/11/04/lisp-repl-vendetta-online.html
Vendetta Online has a Lisp environment (using SBCL) which controls much of its NPC behavior and will soon be in charge of generating player and NPC missions. Partly in order to get around some thread-safety issues, and partly for convenience we built an REPL into a secret chat channel. (it only responds to developer accounts)
See http://www.vendetta-online.com/
http://www.vendetta-online.com/h/help.html
Vendetta Online is a MMORPG (massively multiplayer online role-playing game) from Guild Software Inc

European Lisp Symposium
http://european-lisp-symposium.org/

IT Software Community – John W. Verity – LISP Is Back, and It’s Baaaaad!
http://www.itsoftwarecommunity.com/author.asp?doc_id=238067&section_id=1624

Why I love Common Lisp and hate Java « Piece of mine
http://kuomarc.wordpress.com/2012/01/27/why-i-love-common-lisp-and-hate-java/

Why I love Ruby (Part 1)
http://duckpunching.github.com/2011/02/26/why-i-love-ruby-part-1.html
Ruby was also developed slowly, and thoughtfully, from the ground up, using the best-of-the-best from multiple programming paradigms, and from the best-of-breed languages from each of those paradigms … (Smalltalk, Lisp, Perl)

What I want from my Common Lisp vendor and the Common Lisp community
http://groups.google.com/group/comp.lang.lisp/msg/4563e504dba92253?pli=1

fogus: Lisp in 32 lines of Ruby
http://blog.fogus.me/2012/01/25/lisp-in-40-lines-of-ruby/

ahefner: Fun with Lisp: Just Intonation and Microtonality
http://ahefner.livejournal.com/19604.html

ahefner: Lispm archaeology: Compiler Protocols
http://ahefner.livejournal.com/19280.html

Web, games, languages ~ jlongster.com
http://jlongster.com/2012/01/16/outlet-gets-a-personality.html

luciolang/lucio – GitHub
https://github.com/luciolang/lucio
Lucio is a Lisp-like language running on Ruby
for those of you younger readers or find lisp exotic and never know anything about it, you might try
https://plus.google.com/113859563190964307534/posts/Xw8M6WMeaDn

Emacs Lisp Basics
http://xahlee.org/emacs/elisp_basics.html
A guide to the CHICKEN compilation process – The Chicken Scheme wiki

http://wiki.call-cc.org/chicken-compilation-process
Homoiconic and “unrestricted” self modifying code + Is lisp really self modifying?

http://stackoverflow.com/questions/8490616/homoiconic-and-unrestricted-self-modifying-code-is-lisp-really-self-modifyin
Readable s-expressions and sweet-expressions home page: Infix and fewer parentheses in Lisp-like languages

http://www.dwheeler.com/readable/index.html
Many people find Lisp s-expressions hard to read as a programming notation. I’ve developed Lisp programs for decades, and though I can read s-expressions well, I remain dissatisfied with their syntactic limitations.

Eleven Theses on Clojure
http://www.tbray.org/ongoing/When/200x/2009/12/01/Clojure-Theses

M-expression – Wikipedia, the free encyclopedia
http://en.wikipedia.org/wiki/M-expression
In computer programming, M-expressions (or meta-expressions) were intended to be the expressions used to write functions in the Lisp programming language. Data to be manipulated using M-expressions was to be written using S-expressions. M-expressions were used for the original theoretical language in early papers about Lisp, but the first working implementation of Lisp interpreted encodings of M-expressions as S-expressions, and M-expressions were never actually implemented.

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

Keep tuned!

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

March 31, 2012

Lisp: Links, News and Resources (1)

Filed under: Functional Programming, Links, Lisp, Programming Languages — ajlopez @ 7:26 pm

Next Post

If you usually read this blog, you should know about my interest in Lisp programming languages. This is the first post on a series with my collected links.

Structure and Interpretation of Computer Programs
http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html

Structure and Interpretation of Computer Programs, Video Lectures
http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/

Beating the Averages
http://www.paulgraham.com/avg.html

What Made Lisp Different
http://www.paulgraham.com/diff.html

Lisp for the Web
http://www.adampetersen.se/articles/lispweb.htm

L-99: Ninety-Nine Lisp Problems
http://www.ic.unicamp.br/~meidanis/courses/mc336/2006s2/funcional/L-99_Ninety-Nine_Lisp_Problems.html

Growing a Language
http://www.cs.virginia.edu/~evans/cs655/readings/steele.pdf

Getting Started | Lambda the Ultimate
http://lambda-the-ultimate.org/node/492

Lisp Isn’t Really a Programming Language « Learning Lisp
http://lispy.wordpress.com/2007/10/24/lisp-isnt-really-a-programming-language/

Common Lisp – Myths and Legends
http://www.lispworks.com/products/myths_and_legends.html

msnyder.info — Lisp for the Web, Part II
http://msnyder.info/posts/2011/07/lisp-for-the-web-ii/

Automata via Macros
http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-automata-macros/paper.pdf

Hedgehog
http://hedgehog.oliotalo.fi/
Hedgehog is a very concise implementation of a Lisp-like language for low-end and embedded devices.

Stylish Lisp programming techniques
http://www.ccs.neu.edu/home/shivers/newstyle.html

The Rebirth of Lisp
http://silversmalltalk.wordpress.com/2011/01/31/the-rebirth-of-lisp/

Lisp machine
http://en.wikipedia.org/wiki/Lisp_machine

YouTube – Practical Common Lisp
http://www.youtube.com/watch?v=VeAdryYZ7ak

Primacy of syntax
http://fexpr.blogspot.com/

Programing Language: The Glory of Lisp’s cons
http://xahlee.org/UnixResource_dir/writ/lisp_cons.html

YouTube – Land of Lisp- The Music Video!
http://www.youtube.com/watch?v=HM1Zb3xmvMc

Beginning LISP Programming in Ubuntu
http://easyybloger.blogspot.com/2011/06/beginning-lisp-programming-in-ubuntu.html

Investing with lisp
http://www.findinglisp.com/blog/2004/11/investing-with-lisp.html

Review of Structure and Interpretation of Computer Programs
http://www.adampetersen.se/reviews/sicp.htm

Review of Let Over Lambda
http://www.adampetersen.se/reviews/letoverlambda.htm

Make macros and functions integrate more seamlessly
http://www.nujk.com/make-macros-and-functions-integrate-more-seamlessly

Pharen: Lisp -> PHP
http://scriptor.github.com/pharen/index.html

Lisp: Common Lisp, Scheme, Clojure, Emacs Lisp – Hyperpolyglot
http://hyperpolyglot.org/lisp

Social Problems Of Lisp
http://c2.com/cgi/wiki?SocialProblemsOfLisp

Monad Macros in Common Lisp
http://common-lisp.net/project/cl-monad-macros/monad-macros.htm

Lisk – Lisp and Haskell
http://chrisdone.com/posts/2010-11-25-lisk-lisp-haskell.html

The Little Schemer
http://www.ccs.neu.edu/home/matthias/BTLS/

Common Lisp Extensions – Common Lisp Extensions
http://www.chemie.fu-berlin.de/chemnet/use/info/cl/cl_1.html

The Common Lisp Cookbook
http://cl-cookbook.sourceforge.net/

Zach’s Journal
http://xach.livejournal.com/tag/lisp

Arc Tutorial
http://ycombinator.com/arc/tut.txt

And my implementations
http://ajlopez.wordpress.com/category/ajlisp/

More links about Lisp and similar programming languages are coming.

Keep tuned!

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

March 21, 2012

Clojure: Links, News And Resources (5)

Filed under: Clojure, Java, Links, Lisp, Programming Languages — ajlopez @ 8:31 pm

Previous Post
Next Post

Clojure/core — (take 5 william-byrd)
http://clojure.com/blog/2012/02/16/take5-william-byrd.html
William Byrd is a postdoc at Indiana University researching the applicability of declarative programming techniques to high-performance computing domains. In addition, he is one of the three authors of the fantastic book The Reasoned Schemer that walks the reader through the development of a small …

pallet/zi – GitHub
https://github.com/pallet/zi
Zi is a maven plugin for clojure.

mmikulicic / clarsec
https://github.com/mmikulicic/clarsec
Parsec monadic parser ported to clojure

youngnh / parsatron
https://github.com/youngnh/parsatron
Clojure parser combinators

Clojure vs Scala · Compare programming languages · Programming Languages
http://hammerprinciple.com/therighttool/items/clojure/scala
The absolute rankings are interesting for large scale comparisons but when you want to know about two specific languages it’s much more informative to look at how the two fare when they go directly head to head.

Reflections on a real-world Clojure application (take 2)
http://blog.malcolmsparks.com/?p=56
Last night I gave a talk at the London Clojure Users Group (LCUG) about a ‘real-world’ (16K lines-of-code) application we built in less than a year with Clojure at Deutsche Bank.

Doing Things ←
http://www.clojure.net/2012/02/08/Doing-things/
So far, we’ve looked at the sequence monad and the set monad. Hopefully by now you’ve gotten a feel for how m-result and m-bind work for those two examples.

Clojure demo web application using Ring, Compojure, MongoDB and Fusion Charts.
http://www.youtube.com/watch?v=4CFy5C2OvM4&feature=youtu.be
A demo web application using Clojure, Ring, Compojure, MongoDB, Fusion Charts.

The RedMonk Programming Language Rankings: February 2012 – tecosystems
http://redmonk.com/sogrady/2012/02/08/language-rankings-2-2012/
For years now, it has been self-evident to us at RedMonk that programming language usage and adoption has been fragmenting at an accelerating rate

Using dynamic programming to calculate Stirling numbers
http://biesnecker.com/dynamic-programming-stirling-number-calculator.html

IT Software Community – John W. Verity – LISP Is Back, and It’s Baaaaad!
http://www.itsoftwarecommunity.com/author.asp?doc_id=238067&section_id=1624

gelfino
http://documentup.com/narkisr/gelfino/
Gelfino is a tiny embeddable Gelf server written in pure Clojure, Gelfino enables real time processing of log events through streams.

(david-mcneil.com:blog), Clojure Robot DSL
http://david-mcneil.com/post/17044248397/clojure-robot-dsl

Sets Not Lists ←
http://www.clojure.net/2012/02/04/Sets-not-lists/

Functional Relational Programming with Cascalog
http://clojure.com/blog/2012/02/03/functional-relational-programming-with-cascalog.html

Stuart Sierra: “Learning Clojure – Next Steps” | Clojure on Blip
http://blip.tv/clojure/stuart-sierra-learning-clojure-next-steps-5921905
You can conj and assoc like a pro. You eat macros for breakfast.What’s next?

The Pragmatic Bookshelf | PragPub 2011-08 | Hello, ClojureScript!
http://pragprog.com/magazines/2011-08/hello-clojurescript
Clojure rocks, JavaScript reaches. ClojureScript is the realized inevitability of Clojure’s expansion to other platforms.It seems these days you can’t write a web-based application without reaching for JavaScript.

David McNeil: “Concurrent Stream Processing” | Clojure on Blip
http://blip.tv/clojure/david-mcneil-concurrent-stream-processing-5919702
The foundation of our query processing engine is a concurrent data stream processor. This processor is characterized by the need to efficiently perform parallel, non-blocking processing of multiple data streams which are too large to fit in memory.

InfoQ: One () to Rule them All
http://www.infoq.com/presentations/One-Parenthesis-to-Rule-them-All
Aaron Bedra introduces Clojure and details how ClojureScript – a Clojure subset compiled to JavaScript – helps with web development.

Clojure/core — First Conj 2011 Videos Available
http://clojure.com/blog/2012/01/31/first-conj-2011-videos-available.html
Five videos from Clojure Conj 2011 are now available.

Home // Overtone
http://overtone.github.com/
Overtone is an open source audio environment being created to explore musical ideas from synthesis and sampling to instrument building, live-coding and collaborative jamming. We use the SuperCollider synth server as the audio engine, with Clojure being used to develop the APIs and the application. …

On Beyond Lambda: Clojure is one answer
http://onbeyondlambda.blogspot.com/2012/01/my-last-post-was-link-to-video-t...
A travel log of a .NET developer as he explores Clojure and F#, and looks for ways to apply C# to a multi-core world.A travel log of a .NET developer as he explores Clojure and F#, and looks for ways to apply C# to a multi-core world.

richard-lyman/amotoen – GitHub
https://github.com/richard-lyman/amotoen
Amotoen is a Clojure library that supports PEG style definitions of grammars that can produce parsers

Clojure for Ruby Programmers – Stuart Halloway – Ruby Conference 2009
http://confreaks.com/videos/191-rubyconf2009-clojure-for-ruby-programmers

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

Keep tuned!

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

February 22, 2012

Clojure: Links, News And Resources (4)

Filed under: Clojure, Java, Links, Lisp, Programming Languages — ajlopez @ 4:02 pm

Previous Post
Next Post

More links about Clojure programming languages:

Event-Driven Programming in Clojure
http://www.infoq.com/presentations/Event-Driven-Programming-in-Clojure

Beginning with Clojure
http://clojurelx.blogspot.com/2012/01/beginning-with-clojure.html

The Making of Typkov
http://www.youtube.com/watch?v=uTwnoZEw7FE&feature=youtu.be
Build a little webapp in Clojure/Noir from scratch

Clojure GUI Demo of Planetary Orbitals
http://juliangamble.com/blog/2012/01/23/clojure-gui-demo-of-planetary-orbitals/

Metaweblog API
https://github.com/brehaut/necessary-evil/wiki/Metaweblog-API

Backlog: Ola Bini on Clojure/conj
http://www.leonardoborges.com/writings/2012/01/22/backlog-ola-bini-on-clojure-conj/

Why Jark
http://icylisper.in/jark/
Startup time of the Java Virtual Machine(JVM) is quite slow and thereby command-line applications on the JVM are sluggish and very painful to use. Jark is an attempt to run a persistent JVM daemon and provide a set of utilities to interact with it.

All Your HBase Are Belong to Clojure
http://twitch.nervestaple.com/2012/01/12/clojure-hbase/

Introducing ClojureScript One
http://clojure.com/blog/2012/01/11/announcing-clojurescript-one.html
Here at Relevance, we spent some time recently looking at the ClojureScript experience. We were specifically concerned with finding the pain points in ClojureScript development. To make the experience as real as possible, we chose to rewrite a client application which had been written in CoffeeScript.

ClojureScript One
http://clojurescriptone.com/
ClojureScript One shows you how to use ClojureScript to build single-page, single-language applications in a productive, effective and fun way.

Object-oriented Clojure
http://css.dzone.com/articles/object-oriented-clojure

Web application in Clojure: the starting poin
http://css.dzone.com/articles/web-application-clojure

Some Thoughts on Classes After 18 Months of Clojure
http://vimeo.com/34522837

Create a basic web application in clojure
http://www.agilogy.com/blog/create-a-basic-web-application-in-clojure.html

fogus / fojure
https://github.com/fogus/fojure
a dumb little fp language written in Clojure

Immutant
http://immutant.org/
Immutant is an application server for Clojure built on top of JBoss AS7. It is a new project, but we already support Ring handlers and asynchronous messaging, and we are working on additional features.

My Clojure Adventure
http://www.myclojureadventure.com/

ClojureCLR
http://clojureclr.blogspot.com/

Getting Started with Clojure-clr
http://www.myclojureadventure.com/2011/10/getting-started-with-clojure-clr.html

roman / clj-stream
https://github.com/roman/clj-stream
Oleg’s Iteratees in Clojure

Road-map – or n+1 steps to enlightenment (or loonybind)
http://clojurelx.blogspot.com/2011/11/road-map-or-n1-steps-to-enlightenment.html

geoffsalmon / bytebuffer
https://github.com/geoffsalmon/bytebuffer
Clojure lib for packing and unpacking binary data using a java.util.ByteBuffer

Survey says: viability is number one
http://clojureclr.blogspot.com/2011/11/survey-says-viability-is-number-one.html

ClojureCLR has a new home
http://clojureclr.blogspot.com/2011/11/clojureclr-has-new-home.html

Clojure
http://groups.google.com/group/clojure/msg/d52aff66b951b460?pli=1

What is a multimethod?
http://krisjordan.com/multimethod-js

4Clojure
http://www.4clojure.com/
4Clojure is a resource to help fledgling clojurians learn the language through interactive problems. The first few problems are easy enough that even someone with no prior experience should find the learning curve forgiving.

Testing Storm Topologies (in Clojure)
http://www.pixelmachine.org/2011/12/17/Testing-Storm-Topologies.html

Maven Settings and Repositories
http://dev.clojure.org/display/doc/Maven+Settings+and+Repositories

dmansen / boggle
https://github.com/dmansen/boggle
A boggle solver, in clojure

Fractals in Clojure – Distributed Buddhabrot Fractal Using ClojureScript
http://nakkaya.com/2011/12/15/fractals-in-clojure-distributed-buddhabrot-fractal-using-clojurescript/

marick / Midje
https://github.com/marick/Midje
Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing

The Barbarians are at the Gates
http://blog.8thlight.com/uncle-bob/2011/12/11/The-Barbarians-are-at-the-Gates.html
By @unclebob

(take 6 carin-meier)
http://clojure.com/blog/2011/12/12/take6-carin-meier.html
Carin Meier is a veteran of the Clojure Conj scene having attended both installments and a true asset to both the Ruby and Clojure communities.

Tips for using marginalia
http://www.lispcast.com/tips-for-marginalia

Converting Command Line String Integers To Integers
http://drknucklehead.wordpress.com/2011/12/08/converting-command-line-string-integers-to-integers/

bitsai / clojure-actors
https://github.com/bitsai/clojure-actors
Actors implemented on top of Clojure agents

Erlang style actors implemented using clojure agents
https://github.com/bertschi/clojure-stuff/blob/master/src/stuff/actors.clj

stathissideris / clarity
https://github.com/stathissideris/clarity
A wrapper for Swing aiming to provide more concise syntax and extra functionality. Still in heavy development, syntax may change radically.

Introducing Clarity: Swing application development for Clojure
http://skillsmatter.com/podcast/scala/lightening-talk-clarity-a-wrapper-for-swing

A Refreshed View on Community : Clojure Conj 2011
http://www.uiandtherest.com/ui/index.php/2011/11/11/a-refreshed-view-on-community-clojure-conj-2011/

Clojure: STMs vs Locks
http://www.azulsystems.com/blog/cliff/2008-05-27-clojure-stms-vs-locks

Clojure for dummies: a kata
http://java.dzone.com/articles/clojure-dummies-kata-0

Introducing Avout: Distributed State in Clojure
http://clojure.com/blog/2011/11/29/avout.html

The Clojure Community and Me
http://blog.raynes.me/blog/2011/11/27/the-clojure-community-and-me/

Clojure’s protocols influences?
http://stackoverflow.com/questions/3682011/clojures-protocols-influences

Evangelizing Clojure
http://rhebus.posterous.com/79870335

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

More links about Clojure, Lisp, Functional Programming and Languages are coming.

Keep tuned!

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

December 15, 2011

AjLisp in Ruby (2) Context with Name and Values

Previous Post

One of the first classes I implemented in AjLispRb is the environment. This time I called it a context: a dictionary where to save name/values, to store the atom values. The code:

module AjLisp
class Context
    def initialize(parent = nil)
        @parent = parent
        @values = Hash.new
    end
    
    def getValue(name)
        if @values.has_key?(name)
            return @values[name]
        end
        
        if @parent != nil
            return @parent.getValue(name)
        end
        
        return nil
    end
    
    def setValue(name, value)
        @values[name] = value
    end
end
end

The class was coded using TDD, the first tests at test/test_context.rb. Some tests:

def test_not_defined_is_nil
    context = AjLisp::Context.new
    assert_nil(context.getValue(:foo))
end
def test_set_and_get_value
    context = AjLisp::Context.new
    context.setValue(:foo, "bar")
    assert_equal("bar", context.getValue(:foo))
end
def test_get_value_from_parent
    parent = AjLisp::Context.new
    parent.setValue(:foo, "bar")
    context = AjLisp::Context.new(parent)
    assert_equal("bar", context.getValue(:foo))
end

Initially, I used strings for names, but now I'm using Ruby symbols like :foo. I have a test that ensures the independence of parent and child context values:

def test_override_value_from_parent
    parent = AjLisp::Context.new
    parent.setValue(:foo, "bar")
    context = AjLisp::Context.new(parent)
    context.setValue(:foo, "bar2")
    assert_equal("bar2", context.getValue(:foo))
    assert_equal("bar", parent.getValue(:foo))
end

Each context can have a parent. There is a top context, defined in lib/ajlisp.rb:

module AjLisp
@context = Context.new
@context.setValue :quote, FPrimitiveQuote.instance
@context.setValue :first, PrimitiveFirst.instance
@context.setValue :rest, PrimitiveRest.instance
@context.setValue :cons, PrimitiveCons.instance
@context.setValue :list, PrimitiveList.instance
@context.setValue :lambda, FPrimitiveLambda.instance
@context.setValue :flambda, FPrimitiveFLambda.instance
@context.setValue :mlambda, FPrimitiveMLambda.instance
@context.setValue :let, FPrimitiveLet.instance
@context.setValue :define, FPrimitiveDefine.instance
@context.setValue :do, FPrimitiveDo.instance
@context.setValue :if, FPrimitiveIf.instance
@context.setValue :definef, FPrimitiveDefinef.instance
@context.setValue :definem, FPrimitiveDefinem.instance
@context.setValue :+, PrimitiveAdd.instance
@context.setValue :-, PrimitiveSubtract.instance
@context.setValue :*, PrimitiveMultiply.instance
@context.setValue :/, PrimitiveDivide.instance
def self.context
    return @context
end
# ...
end

New context are created in many primitives. At the begin, there is a top context like:

If you have a defined form that returns the second element of a list:

(define second (a) (first (rest a)))

now you have a top context with the new slot:

The top context has a new slot named second with a lambda value (lambda (a) (first (rest a))

When you invoke:

(second (quote (one two three)))

during the invocation a new context is created, its parent set to the top context, and having a new name/value pair:

That context is discarded after second evaluation (unless the context were referenced by recently created closure, details in upcoming post). When you define a simple value:

(define one 1)

the top context is modified, to have a new name/value pair:

Next topics: primitives and special form primitives, their invocation, closures, macros, native methods invocation.

Keep tuned!

Angel “Java” Lopez

http://www.ajlopez.com

http://twitter.com/ajlopez

December 9, 2011

Clojure: Links, News and Resources (3)

Filed under: Clojure, Java, Links, Lisp, Programming Languages, Web Development — ajlopez @ 1:43 pm

Previous Post
Next Post

More links about Clojure, this time, oriented to Web Development:

Conjure
https://github.com/macourtney/Conjure
A Rails like framework for Clojure

Building a Clojure Web application with Incanter, Compojure, and Leiningen
http://data-sorcery.org/2009/11/29/incanter-webapp/

Cascade
https://github.com/hlship/cascade/wiki/
Cascade is an action-oriented web framework written in idiomatic Clojure

Benefits of using Clojure (Lisp) in web/enterprise development
http://bitumenframework.blogspot.com/2009/09/benefits-of-using-clojure-lisp-in.html

a minimal web app
http://www.learningclojure.com/2009/09/minimal-web-app.html

Snakes on the Web
http://jacobian.org/writing/snakes-on-the-web/

sjl / newseasons
https://github.com/sjl/newseasons
A simple Clojure webapp for notifying users when new seasons of their favorite TV shows hit iTunes.

One syntax to rule them all
http://wagjo.blogspot.com/2011/07/one-syntax-to-rule-them-all.html

Hello Web : Dynamic Compojure Web Development at the REPL
http://www.learningclojure.com/2011/03/hello-web-dynamic-compojure-web.html

Clojure on Heroku with Noir and Mongo in 10 minutes
http://thecomputersarewinning.com/post/clojure-heroku-noir-mongo

ulsa / cljvaadin
https://github.com/ulsa/cljvaadin
Sample Vaadin web app using Clojure

Noir
http://www.webnoir.org/
The Clojure web framework

Deploying a Clojure web app on Heroku
http://blog.jayway.com/2011/06/13/deploying-a-clojure-web-app-on-heroku/

Tackling my first Clojure project, a Graphical HTTP Benchmarker
http://blog.andrewvc.com/tackling-my-first-jlojure-project-a-graphical

A BRIEF OVERVIEW OF THE CLOJURE WEB STACK
http://brehaut.net/blog/2011/ring_introduction

Clojure on Heroku
https://gist.github.com/1001206

dbyrne / 4clojure
https://github.com/dbyrne/4clojure/
An interactive problem website for Clojure beginners.

The Universal Server
http://vimeo.com/21825857
In this code cast I demonstrate the awasomeness of dynamic programming languages by showing how to interactively create and use a universal server, inspired by Joe Armstrong.

Reddit Clone in 10 minutes and 91 lines of Clojure
http://bestinclass.dk/index.clj/2010/02/reddit-clone-in-10-minutes-and-91-lines-of-clojure.html

Interactive Web Development with Clojure
http://charsequence.blogspot.com/2010/09/interactive-web-development-with.html

Building REST APIs for Clojure Web Applications
http://mmcgrana.github.com/2010/08/clojure-rest-api.html

Developing and Deploying a Simple Clojure Web Application
http://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applications.html

Clojure Web Development with Ring
http://mmcgrana.github.com/2010/03/clojure-web-development-ring.html

My Links
http://delicious.com/ajlopez/clojure+webdevelopment

More link about Clojure and Lisp are coming.

Keep tuned!

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

December 2, 2011

AjLisp in Ruby (1) Structure, Classes and Tests

Filed under: AjLisp, Lisp, Programming Languages, Ruby, Test-Driven Development — ajlopez @ 10:57 am

Next Post

I’m learning and practicing Ruby writing my AjLisp interpreter, as usual (early this year, I ported it to Javascript). TDD is my friend: write a test, run in red, code, run in green, refactor, and so on. My code, work in progress, is at:

https://github.com/ajlopez/AjLispRb

Initially, I wrote a single file, following the great and simple example:

http://kanemar.com/2006/03/04/screencast-of-test-driven-development-with-ruby-part-1-a-simple-example/

Notice that Ruby has a ‘test/unit’ package, already in place, ready to use, after installation. After some research, I spitted the file in production code, and test code. I want to build a gem (Ruby package), so I studied the tutorial:

http://guides.rubygems.org/

I have pending readings:

http://speakerdeck.com/u/pat/p/cut-polish-a-guide-to-crafting-gems
http://blog.thepete.net/2010/11/creating-and-publishing-your-first-ruby.html

My code is not a gem, yet. But it have some gem structure:

The lib contains a single file:

require 'ajlisp/list.rb'
require 'ajlisp/named_atom.rb'
require 'ajlisp/context.rb'
require 'ajlisp/string_source.rb'
require 'ajlisp/token.rb'
require 'ajlisp/lexer.rb'
require 'ajlisp/parser.rb'
require 'ajlisp/primitive.rb'
require 'ajlisp/primitive_first.rb'
require 'ajlisp/primitive_rest.rb'
require 'ajlisp/primitive_cons.rb'
require 'ajlisp/primitive_list.rb'
require 'ajlisp/primitive_closure.rb'
require 'ajlisp/fprimitive.rb'
require 'ajlisp/fprimitive_quote.rb'
require 'ajlisp/fprimitive_lambda.rb'
require 'ajlisp/fprimitive_flambda.rb'
require 'ajlisp/fprimitive_let.rb'
require 'ajlisp/fprimitive_closure.rb'
require 'ajlisp/fprimitive_define.rb'
require 'ajlisp/primitive_add.rb'
module AjLisp
@context = Context.new
@context.setValue "quote", FPrimitiveQuote.instance
@context.setValue "first", PrimitiveFirst.instance
@context.setValue "rest", PrimitiveRest.instance
@context.setValue "cons", PrimitiveCons.instance
@context.setValue "list", PrimitiveList.instance
@context.setValue "lambda", FPrimitiveLambda.instance
@context.setValue "flambda", FPrimitiveFLambda.instance
@context.setValue "let", FPrimitiveLet.instance
@context.setValue "define", FPrimitiveDefine.instance
@context.setValue "+", PrimitiveAdd.instance
def self.context
    return @context
end
def self.evaluate(context, item)
    if item.is_a? List or item.is_a? NamedAtom
        return item.evaluate(context)
    end

    return item
end
end

I wrote some primitives (normal forms, and special forms: the latter don’t evaluate their parameters before apply, like quote or define). Notice that the additional files are in a subfolder ajlisp inside lib, why? Because when this code is installed as a gem, all lib file code could be include with require(‘thenameofrubyfile’). If I put other files than ajlisp.rb, i.e. list.rb or atom.rb, those file names could be required, and maybe a name collision with other gems could occur. Then, the recommended practice (see other gem code in your Ruby installation folder) is to put additional files below lib folder.

In the test folder there is a top test.rb file that includes other test files:

require 'ajlisp'
require 'test/unit'
require "test_list.rb"
require "test_named_atom.rb"
require "test_context.rb"
require "test_string_source.rb"
require "test_token.rb"
require "test_lexer.rb"
require "test_parser.rb"
require "test_primitive_first.rb"
require "test_primitive_rest.rb"
require "test_primitive_cons.rb"
require "test_primitive_list.rb"
require "test_primitive_closure.rb"
require "test_primitive_add.rb"
require "test_fprimitive_quote.rb"
require "test_fprimitive_lambda.rb"
require "test_fprimitive_let.rb"
require "test_fprimitive_closure.rb"
require "test_fprimitive_flambda.rb"
require "test_fprimitive_define.rb"
require "test_evaluate"

so you can run the tests from command line:

ruby –Ilib;test test\test.rb

If you have Windows, the runtest.cmd file contains this line.

Some test code:

require 'ajlisp'
require 'test/unit'
class TestList < Test::Unit::TestCase
#... 
    def test_create_with_first
        list = AjLisp::List.new("foo")
        assert_equal("foo", list.first)
        assert_nil(list.rest)
    end

    def test_create_with_first_and_rest
        rest = AjLisp::List.new("bar")
        list = AjLisp::List.new("foo", rest)
        assert_equal("foo", list.first)
        assert_not_nil(list.rest)
        assert_equal("bar", list.rest.first)
        assert_nil(list.rest.rest)
    end

    def test_create_from_array
        list = AjLisp::List.make [1, "a", "foo"]
        assert_not_nil list
        assert_equal 1, list.first
        assert_equal "a", list.rest.first
        assert_equal "foo", list.rest.rest.first
        assert_nil list.rest.rest.rest
    end
#..
end

Every list is an object of this class, list.rb:

module AjLisp
class List
    attr_reader :first
    attr_reader :rest

    def initialize(first=nil, rest=nil)
        @first = first
        @rest = rest
    end

    def evaluate(context)
        form = AjLisp::evaluate(context, @first)
        form.evaluate(context, self)
    end

    def self.make(array)
        if array and array.length > 0
            first = array.shift

            if first.is_a? Array
                first = make(first)
            elsif first.is_a? Symbol
                first = NamedAtom.new first.to_s
            end

            return List.new first, make(array)
        end 

        return nil
    end
end
end

The accessors first and rest are read-only. Thanks to the untyped nature of Ruby (like in Javascript) the implementation of this interpreter is straightforward, or without much code ceremony, at least.

In my new tests, I included the code into the AjLisp module, so I don’t need to write AjLisp:: prefix before referencing a class:

require 'ajlisp'
require 'test/unit'
module AjLisp
class TestLexer < Test::Unit::TestCase
    def test_get_atom_token
        source = StringSource.new "atom"
        lexer = Lexer.new source
        token = lexer.nextToken

        assert_not_nil token
        assert_equal "atom", token.value
        assert_equal TokenType::ATOM, token.type
        assert_nil lexer.nextToken
    end
    def test_get_atom_token_with_spaces
        source = StringSource.new " atom "
        lexer = Lexer.new source
        token = lexer.nextToken

        assert_not_nil token
        assert_equal "atom", token.value
        assert_equal TokenType::ATOM, token.type
        assert_nil lexer.nextToken
    end
#...
end

Next topics: some implementation details, primitives vs fprimitives, context (nested environments with name/values), lambda and closures, lexer and parser.

Next steps: complete primitives (let, letrec, definef, do, if…), macro (mlambda, definem, macro expansion…)

Keep tuned!

Angel “Java” Lopez

http://www.ajlopez.com

http://twitter.com/ajlopez

November 23, 2011

Clojure: Links, News And Resources (2)

Filed under: Clojure, Links, Lisp — ajlopez @ 9:26 am

Previous Post
Next Post

More about Clojure programming language, this time oriented to tutorials:

Quick Ref for Clojure Core
http://clojuredocs.org/quickref/Clojure%20Core
Programming language development: the past 5 years
http://blog.fogus.me/2011/10/18/programming-language-development-the-past-5-years/

Clojure – Getting started
http://dev.clojure.org/display/doc/Getting+Started

How to learn Clojure effectively
http://fronx.posterous.com/how-to-learn-clojure-effectively

Clojure Building Blocks
http://pragprog.com/magazines/2011-07/clojure-building-blocks

Clojure and the CLR
http://odetocode.com/Blogs/scott/archive/2011/08/15/clojure-and-the-clr.aspx

Coming Close To Clojure–Part 1
http://codingndesign.com/blog/?p=239

Using Leiningen to build Clojure code
http://alexott.net/en/clojure/ClojureLein.html

Writing Elegant Clojure Code Using Higher-Order Functions
http://christophermaier.name/2011/07/07/writing-elegant-clojure-code-using-higher-order-functions.html

Compiling Clojure to Javascript pt. 1 of n
http://blog.fogus.me/2011/07/21/compiling-clojure-to-javascript-pt1/

Growing a DSL with Clojure
http://pragprog.com/magazines/2011-07/growing-a-dsl-with-clojure

PragPub—July 2011
http://pragprog.com/magazines/2011-07/content
Four Clojure articles

Clojure on Heroku
http://blog.heroku.com/archives/2011/7/5/clojure_on_heroku/

Cljr
http://www.maybetechnology.com/2011/07/cljr.html
Well this is new: https://github.com/liebke/cljr. A very simple way to move from zero to a working Clojure REPL

Guide to Programming in Clojure for Beginners
http://blackstag.com/blog.posting?id=5

Clojure: Immutability at the Language Level
http://www.developer.com/lang/other/article.php/3874551/Clojure-Immutability-at-the-Language-Level.htm

Clojure: Towards The Essence Of Programming (What’s Next? Conference, May 2011)
http://www.slideshare.net/hlship/clojure-essenceprogramming

Java-Clojure Interop: Calling Clojure From Java
http://java.dzone.com/articles/java-clojure-interop-calling

4Clojure
http://www.4clojure.com/problems

ANTLR via Clojure
http://briancarper.net/blog/554/antlr-via-clojure

Stack-based Calculator Kata in Clojure
http://vimeo.com/23014256

Clojure abstractions
http://tech.puredanger.com/2011/03/11/clojure-abstractions/

Build your own Clojure toolkit
http://amalloy.hubpages.com/hub/Build-your-own-Clojure-toolkit

The Clojure programming language
http://www.ibm.com/developerworks/library/os-eclipse-clojure/

Clojure: Deriving the Y Combinator in 7 Stolen Steps
http://citizen428.net/blog/2010/12/14/clojure-deriving-the-y-combinator-in-7-stolen-steps/

Taking Uncle Bob to school
http://bestinclass.dk/index.clj/2010/10/taking-uncle-bob-to-school.html

Clojure Cookbook
http://www.gettingclojure.com/cookbook:clojure-cookbook

Grokking Functional Data Structures
http://debasishg.blogspot.com/2010/05/grokking-functional-data-structures.html

Clojure Notes
http://clojure-notes.rubylearning.org/

Scalable Scraping in Clojure
http://dev.lethain.com/scalable-scraping-in-clojure/

SICP in Clojure
http://sicpinclojure.com/
Structure and Interpretation of Computer Programs adapted for the Clojure programming language

Software Transactional Memory
http://java.ociweb.com/mark/stm/article.html

Learning Clojure
http://en.wikibooks.org/wiki/Learning_Clojure

My links
http://delicious.com/ajlopez/clojure+tutorial+toblog

Keep tuned!

Angel “Clojure” 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