Monthly Archives: May 2012

AjGenesis Code Generation in .NET, Javascript and Ruby, All the Gates are Open

Usually, I get up early in the morning. Today, I got up a bit earlier, with some ideas about how to implement a simple template engine for my personal project, AjGenesis in Ruby. Then, I put my hands at work, and 3 hours later I had a solution, built using TDD (I made frequent commits, so you can see the progress of development in the GitHub Log).

The result at my GitHub account:

https://github.com/ajlopez/AjGenesisRb

Initially, I planned to use one of the template engines already available in Ruby, like Haml. But I decided to write my own implementation. Past week, I wrote AjGenesis in Javascript/NodeJs, see:

https://github.com/ajlopez/AjGenesisNode

In that project, I separated the template engine in another package:

https://github.com/ajlopez/SimpleTpl

In this way, I designed the template format to be similar to the original templates in classic AjGenesis.

I reuse the Javascript template engine in another new project (code kata of the past weekend):

https://github.com/ajlopez/SimpleMvc

a simple MVC implementation over NodeJs/Express.

So, now you have three projects:

Classical AjGenesis code generation, implemented in .NET (see examples folder)
AjGenesis in Javascript/Node, with SimpleTpl template engine, with interpolated Javascript expressions, and embedded Javascript commands (see samples folder)
AjGenesis in Ruby, with a similar internal template engine, with interpolated Ruby expressions, and embedded Ruby commands (see samples folder)

AjGenesis in Javascript was published to npm (node package manager) as beta.

AjGenesis in Ruby is still not a gem: work in progress.

REMEMBER: all these projects GENERATES the text artifacts YOU WANT to generate. There are not limited to a technology, platform or programming languages.

It’s really interesting to see how simple ideas can be reimplemented in dynamic languages. Next steps: more samples, ruby gem, node package, and web site implementing code generation as a service (ASP.NET implementation commented in my old post). (see AjGenesis: Basis of Its Implementation).

Pending implementation languages: Python, maybe Java.

(Original photo from: http://commons.wikimedia.org/wiki/File:Table_Rock_Dam_during_April_2008_White_River_Flood.jpg)

Keep tuned!

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

Compilers: Links, News And Resources (3)

Previous Post
Next Post

More links about compiler implementations, ideas, interpreters, and programming languages:

Pharo Opal Compiler
http://www.slideshare.net/jressia/opal-compiler

Microsoft’s Roslyn: Reinventing the compiler as we know it
http://www.infoworld.com/d/application-development/microsofts-roslyn-reinventing-the-compiler-we-know-it-176671

Roslyn CTP Now Available
http://blogs.msdn.com/b/somasegar/archive/2011/10/19/roslyn-ctp-available-now.aspx

Why Clojure Doesn’t Need Invokedynamic (Unless You Want It to be More Awesome)
http://blog.headius.com/2011/10/why-clojure-doesnt-need-invokedynamic.html

C#5 and Meta-Programming
http://codebetter.com/patricksmacchia/2010/05/31/c-5-and-meta-programming/

Roslyn: Compiler as a Service, not a black-box anymore!
http://www.codequake.com/post/2011/09/16/Roslyn-Compiler-as-a-Service-not-a-black-box-anymore!.aspx

Project Roslyn or Compiler-as-a-Service. Bringing flexibility of dynamic languages to C#
http://blog.softelegance.com/net/project-roslyn-or-compiler-as-a-service-bringing-flexibility-of-dynamic-languages-to-c/

Microsoft previews Compiler-as-a-Service software
http://www.computerworld.com/s/article/9220056/Microsoft_previews_Compiler_as_a_Service_software

oscompiler
http://code.google.com/p/oscompiler/
O# (managed Objective-C) Compiler (requires .NET 4)

Microsoft previews Compiler-as-a-Service software
http://www.techworld.com.au/article/401071/microsoft_previews_compiler-as-a-service_software/#closeme

GNU Objective-C runtime features
http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Objective-C.html

An Introduction to Objective-C for .NET Programmers
http://www.qckapp.com/index.html?p=ObjC

Opa – a unified approach to web programming
http://www.i-programmer.info/news/98-languages/2961-opa-a-unified-approach-to-web-programming.html
Opa is a new open source language that lets you write an app and compile it to a JavaScript application on the client, complete with server-side support including a database.

Clojure, JVM 7 support (invokedynamic)
https://groups.google.com/group/clojure/msg/dd82cc60855b1ca3

RES – An Open Cobol To Java Translato
http://sourceforge.net/projects/opencobol2java/

Making Ruby Fast: The Rubinius JIT
http://www.engineyard.com/blog/2010/making-ruby-fast-the-rubinius-jit/
by @dseminara

Introducing ClojureScript
http://clojure.com/blog/2011/07/22/introducing-clojurescript.html
by @stuartsierra

ClojureScript Rationale
https://github.com/clojure/clojurescript/blob/master/devnotes/cljs.org
by @stuarthalloway

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

Scala comes to .Net
http://www.scala-lang.org/node/10299
Miguel Garcia, part of the Scala group at EPFL, has been striving to make the Scala productivity available to .Net developers too. In a project funded by Microsoft, he has now reached a major milestone in delivering that capability.

List of languages that compile to JS
https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS

Ferret: An Experimental Clojure Compiler
http://nakkaya.com/2011/06/29/ferret-an-experimental-clojure-compiler/

Precompile your MVC Razor views using RazorGenerator
http://blog.davidebbo.com/2011/06/precompile-your-mvc-views-using.html

Razor Generator
http://razorgenerator.codeplex.com/

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

Keep tuned!

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

Compilers: Links, News And Resources (2)

Previous Post
Next Post

More links about compiler implementations, ideas and technologies:

jitasm
http://code.google.com/p/jitasm/
jitasm is C++ library for runtime code generation of x86/x64. You can write the code like a inline assembler.

Compiling Scala to LLVM
https://days2011.scala-lang.org/sites/days2011/files/ws3-2-scalallvm.pdf

Groovy Goodness: Add AST Transformations Transparently to Scripts
http://mrhaki.blogspot.com.ar/2011/06/groovy-goodness-add-asttransformations.html
With Groovy 1.8 we can add compilation customizers when for example we want to run a Groovy script from our application code.

Jabaco
http://www.jabaco.org/
Jabaco is a simple programming language with a Visual Basic like syntax. Jabaco enables you to create powerful software for all Java supported operating systems.

How To Write a Console Application in PowerShell with Add-Type
http://blogs.msdn.com/b/powershell/archive/2009/01/03/how-to-write-a-console-application-in-powershell-with-add-type.aspx

Type inference
http://en.wikipedia.org/wiki/Type_inference
Type inference refers to the automatic deduction of the type of an expression in a programming language. If some, but not all, type annotations are already present it is referred to as type reconstruction.

LLVM Language Reference Manual
http://llvm.org/docs/LangRef.html

AntLr LLVM
http://www.antlr.org/wiki/display/ANTLR3/LLVM
Example of how to use ANTLR+StringTemplate with LLVM to build a compiler.

Implementing the virtual method pattern in C#, Part Two
http://blogs.msdn.com/b/ericlippert/archive/2011/03/21/implementing-the-virtual-method-pattern-in-c-part-two.aspx

XmlVm
http://xmlvm.org/overview/
The goal of XMLVM is to offer a flexible and extensible cross-compiler toolchain. Instead of cross-compiling on a source code level, XMLVM cross-compiles byte code instructions from Sun Microsystem’s virtual machine and Microsoft’s Common Language Runtime.

Engineering a Compiler, 2nd Edition
http://store.elsevier.com/product.jsp?isbn=9780120884780

Implementing Smalltalk’s Non-Local Returns in JavaScript
http://silversmalltalk.wordpress.com/2011/02/02/implementing-smalltalks-non-local-returns-in-javascript/

Smalltalk Classes in JavaScript
http://silversmalltalk.wordpress.com/2011/02/02/smalltalk-classes-in-javascript/

A Linux Compiler Deathmatch: GCC, LLVM, DragonEgg, Open64, Etc…
http://www.phoronix.com/scan.php?page=article&item=linux_compiler_deathmatch&num=1

Pharen: Lisp -> PHP
http://scriptor.github.com/pharen/index.html
Pharen is a compiler that takes a Lisp-like language and turns it into PHP code. This combines Lisp’s advantages of uniform syntax and homoiconicity (among others) and PHP’s advantage of…being everywhere.

clojurejs — a Clojure (subset) to Javascript translator
http://cynojure.posterous.com/clojurejs-a-clojure-subset-to-javascript-tran

timcameronryan / mug
https://github.com/timcameronryan/mug
A self-hosted JavaScript compiler for the JVM. Written in CoffeeScript

Mono’s C# Compiler as a Service on Windows.
http://tirania.org/blog/archive/2010/Apr-27.html

Smalltalk in small talks: The Setup
http://blog.redline.st/2010/12/15/smalltalk-in-small-talks-the-setup/
Smalltalk in Java

Xbase interactive programming environment
http://sebastianbenz.de/introducing-an-interactive-programming-enviro
One of the exciting new features of the upcoming Xtext 2.0 is the integration of the general purpose expression language Xbase.

Compiler in Clojure
http://dev.clojure.org/display/design/Compiler+in+Clojure
The Clojure compiler is currently a large Java class. Writing it in Clojure will produce many benefits

jarpiain / cljc
https://github.com/jarpiain/cljc
A clojure port of the clojure compiler

Inside Razor – Part 3 – Templates
http://vibrantcode.com/blog/2010/8/2/inside-razor-part-3-templates.html

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

More links about interpreters, compilers and programming languages are coming.

Keep tuned!

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

Compilers: Links, News and Resources (1)

Next Post

Since the late seventies, I am a programming language geek. I remember my first contact with COBOL, Fortran, Algol/W, assembly language for mainframes and BCPL. In recent years, I was studying new languages implementations, in the form of interpreter, virtual machine and compilers. This is part of the links I found interesting in the last years.

CrossNet
http://crossnet.codeplex.com/
It parses .NET assemblies and generates unmanaged C++ code that can be compiled on any standard C++ compiler.

Mono CSharp Compiler
http://www.mono-project.com/CSharp_Compiler
The Mono C# compiler is considered feature complete for C# 1.0, C# 2.0, C# 3.0 and C# 4.0 (ECMA).

Bytecode 2011
http://software.imdea.org/~pierreganty/bytecode2011/

Write A Template Compiler For Erlang
http://evanmiller.org/write-a-template-compiler-for-erlang.html

alvaroc1 / s2js
https://github.com/alvaroc1/s2js
Scala to Javascript compiler

Clojure Faster than Machine Code?
http://www.learningclojure.com/2010/09/clojure-faster-than-machine-code.html

Clojure++
http://combinate.us/clojure/2010/09/27/clojure/

On FaceBook’s Thrift semantics, code generation, and OCaml
http://lionet.info/asn1c/blog/2010/07/18/thrift-semantics/

pseudo-language
http://code.google.com/p/pseudo-language/

talc
http://code.google.com/p/talc/

Introduction to GOLD Parser
http://www.codeproject.com/Articles/10492/Introduction-to-GOLD-Parser

Antlr
http://www.antlr.org/

Irony – .NET Language Implementation Kit
http://irony.codeplex.com/
Irony is a development kit for implementing languages on .NET platform. Unlike most existing yacc/lex-style solutions Irony does not employ any scanner or parser code generation from grammar specifications written in a specialized meta-language. In Irony the target language grammar is coded directly in c# using operator overloading to express grammar constructs.

Interpreter and Compiler
http://www.pasteur.fr/formation/infobio/python/ch05s02.html

Compiling .NET code on-the-fly
http://www.codeproject.com/Articles/5472/Compiling-NET-code-on-the-fly

Dynamic Creation of Assemblies/Apps
http://www.codeproject.com/Articles/23227/Dynamic-Creation-of-Assemblies-Apps

NScript – A script host for C#/VB.NET/JScript.NET
http://www.codeproject.com/Articles/3207/NScript-A-script-host-for-C-VB-NET-JScript-NET
NScript is a tool similar to WScript except that it allows scripts to be written in .NET languages such as C#, VB.NET and JScript.NET. NScript automatically compiles the code into an assembly in memory and executes the assembly.

CodeDom Assistant
http://www.codeproject.com/Articles/20597/CodeDom-Assistant
Generating CodeDom Code By Parsing C# or VB

Building .NET Assemblies Dynamically
http://www.csharpfriends.com/articles/getarticle.aspx?articleid=118

A Simple Compiler for the Common Language Runtime
http://www.codeproject.com/Articles/4082/A-Simple-Compiler-for-the-Common-Language-Runtime
An end-to-end example of a bottom up LALR(1) compiler for a fictitious language targeting the Common Language Runtime

Clojure COmpilation
http://clojure.org/compilation
Ahead-of-time Compilation and Class Generation

he Lisp Before the End of My Lifetime
http://metalinguist.wordpress.com/2007/08/04/the-lisp-before-the-end-of-my-lifetime/

Hydrating Objects With Expression Trees – Part I
http://weblogs.asp.net/paulomorgado/archive/2010/08/16/hydrating-objects-with-expression-trees-part-i.aspx

Mastering Expression Trees With .NET Reflector
http://msmvps.com/blogs/paulomorgado/archive/2010/08/06/mastering-expression-trees-with-net-reflector.aspx

Dumping Objects Using Expression Trees
http://msmvps.com/blogs/paulomorgado/archive/2010/08/03/dumping-objects-using-expression-trees.aspx

Solving the Expression Problem with OOP
http://www.atalasoft.com/cs/blogs/stevehawley/archive/2010/08/12/solving-the-expression-problem-with-oop.aspx

C# compiler as a service
http://weblogs.asp.net/britchie/archive/2010/08/08/c-compiler-as-a-service.aspx

Chicken
http://wiki.call-cc.org/
Chicken is an implementation of the Scheme programming language that can compile Scheme programs to C code as well as interpret them.

Steel Bank Common Lisp
http://www.sbcl.org/
Steel Bank Common Lisp (SBCL) is a high performance Common Lisp compiler

Scheme2Js
http://www-sop.inria.fr/indes/scheme2js/
Scheme2Js is a Scheme to JavaScript compiler

Comparing SPUR to PyPy
http://morepypy.blogspot.com.ar/2010/07/comparing-spur-to-pypy.html

SPUR: A Trace-Based JIT Compiler for CIL
http://research.microsoft.com/en-us/projects/spur/

chandlerkent / HKCD
https://github.com/chandlerkent/HKCD
MiniJava compiler for RHIT compilers course (CSSE 404)

Google Closure Compiler Advanced mode
http://axod.blogspot.com.ar/2010/01/google-closure-compiler-advanced-mode.html

free pascal
http://www.freepascal.org/
Free Pascal (aka FPK Pascal) is a 32 and 64 bit professional Pascal compiler.

VMKit: a substrate for virtual machines
http://vmkit.llvm.org/
The VMKit project is a framework for building virtual machines. It uses LLVM for compiling and optimizing high-level languages to machine code, and MMTk to manage memory.

Hello from a libc-free world! (Part 1)
https://blogs.oracle.com/ksplice/entry/hello_from_a_libc_free

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

Parallel Programming: Links, News And Resources (2)

Previous Post
Next Post

More links about this interesting topic. I think parallel programming is the way to explore new algorithms, specially in artificial intelligence and distributed computing.

Dryad – Microsoft Research
http://research.microsoft.com/en-us/projects/Dryad/

Ville Tuulos on Big Data and Map/Reduce in Erlang and Python with Disco
http://www.infoq.com/interviews/tuulos-erlang-mapreduce
Ville Tuulos talks about Disco, the Map/Reduce framework for Python and Erlang, real-world data mining with Python, the advantages of Erlang for distributed and fault tolerant software, and more.

ICSE 2011: Danny Dig – Retrofitting Parallelism into a Sequential World
http://channel9.msdn.com/posts/ICSE-2011-Danny-Dig
Dr. Danny Dig is a Principal Investigator at the Universal Parallel Computing Research Center (UPCRC Illinois). UPCRC’s stated mission is to make parallel programming synonymous with programming.

Patterns for Parallel Programming: Understanding and Applying Parallel Patterns with the .NET Framework 4
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=19222
A document providing an in-depth tour of implementing a variety of parallel patterns using the .NET Framework 4.

Haskell: First results from GHC’s new garbage collector
http://hackage.haskell.org/trac/ghc/blog/new-gc-preview
For a number of months now, we have been designing and developing a new garbage collector for GHC, with the primary goal of improving scaling on multicores.

Actor-based Programming
http://www.infoq.com/presentations/Actor-based-Programming
Jamie Ridgway explains what actors are, why we need them, what they are helpful for, the languages built around this programming paradigm, along with some demos showing actor-based apps.

Functional Programming eXchange 2011: Simon Peyton Jones on Managing parallelism: embrace diversity, but control side effects
http://skillsmatter.com/podcast/scala/talk-by-haskell-expert-simon-peyton-jones
If you want to program a parallel computer, it obviously makes sense to start with a computational paradigm in which parallelism is the default (ie functional programming), rather than one in which computation is based on sequential flow of control (the imperative paradigm). And yet, and yet … functional programmers have been singing this tune since the 1980s, but do not yet rule the world.

Articles on Parallel Programming with the .NET Framework 4
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=12594
A set of articles that provide information on parallel programming with the .NET Framework 4.

Dynamic parallel async requests in MVC
http://petemontgomery.wordpress.com/2011/05/12/dynamic-parallel-async-requests-in-mvc/
Thanks to AsyncControllers, it’s quite easy to make several asynchronous requests in parallel to different web services, and have MVC gather the results.

GPars
http://gpars.codehaus.org/
Groovy Parallel Systems
The GPars framework offers Java developers intuitive and safe ways to handle Java or Groovy tasks concurrently. Leveraging the enormous flexibility of the Groovy programing language and building on proven Java technologies, we aim to make concurrent programming for multi-core hardware intuitive, robust and enjoyable.

InfoQ: Parallel Programming Patterns: Data Parallelism
http://www.infoq.com/presentations/Parallel-Programming-Patterns
Ralph Johnson presents several data parallelism patterns, including related Java, C# and C++ libraries from Intel and Microsoft, comparing it with other forms of parallelism such as actor programming.

Task Parallel Library: 5 of n – CodeProject
http://www.codeproject.com/KB/cs/Tasks5.aspx
A look into using the Task Parallel Library.

Mired in code: Easy parallel processing in Clojure
http://blog.mired.org/2011/03/easy-parallel-processing-in-clojure.html
For those not familiar with it, the eight queens problem is to place eight queens on a chess board such that none of them are attacking each other. Since queens attack in eight directions, this means that none of them are in the same row or column, and that none of them share a diagonal. It’s interesting, but not incredibly difficult, to do this.

W. Daniel Hillis
http://en.wikipedia.org/wiki/W._Daniel_Hillis
William Daniel “Danny” Hillis (born September 25, 1956, in Baltimore, Maryland) is an American inventor, entrepreneur, and author. He co-founded Thinking Machines Corporation, a company that developed the Connection Machine, a parallel supercomputer designed by Hillis at MIT. He is also co-founder of the Long Now Foundation, Applied Minds, Metaweb, and author of The Pattern on the Stone: The Simple Ideas That Make Computers Work.

Scala Team Wins ERC Grant | The Scala Programming Language
http://www.scala-lang.org/node/8579
The Scala research group at EPFL is excited to announce that they have won a 5 year European Research Grant of over 2.3 million Euros to tackle the “Popular Parallel Programming” challenge. This means that the Scala team will nearly double in size to pursue a truly promising way for industry to harness the parallel processing power of the ever increasing number of cores available on each chip.

Organizing Functional Code for Parallel Execution; or, foldl and foldr Considered Slightly Harmful
http://vimeo.com/6624203
Guy L. Steele, Jr.; Sun Microsystems
International Conference on Functional Programming (ICFP)
Edinburgh 2009
ACM SIGPLAN

InfoQ: How to Think about Parallel Programming: Not!
http://www.infoq.com/presentations/Thinking-Parallel-Programming
Guy L. Steele Jr. believes that it should not be the programmer’s job to think about parallelism, but languages should provide ways to transparently run tasks in parallel. This requires a new approach in building languages supporting algorithms built on independence and build-and-conquer principles rather than on linear decomposition of problems.

Parallel Programming with .NET
http://blogs.msdn.com/b/pfxteam/
All about Async/Await, System.Threading.Tasks, System.Collections.Concurrent, System.Linq, and more…

await anything;
http://blogs.msdn.com/b/pfxteam/archive/2011/01/13/10115642.aspx
One of the very cool things about the new await keyword in C# and Visual Basic is that it’s pattern based.  It works great with Task and Task<TResult>, and awaiting those two types will represent the vast majority of uses, but they’re by no means the only types that can be awaited.  The languages support awaiting any instance that exposes the right method (either instance method or extension method): GetAwaiter.

Professional Parallel Programming with C#: Master Parallel Extensions with .NET 4 (Wrox Programmer to Programmer)
http://www.amazon.com/Professional-Parallel-Programming-Master-Extensions/dp/0470495995

No Callbacks Required: StratifiedJS Returns Sequential Programming to Javascript
http://www.infoq.com/articles/stratifiedjs
Javascript is fundamentally single threaded, no parallel threads in sight. Asynchronous programming is necessary for any task that might block; Javascript programming usually involves creating and passing around a lot of callbacks, essentially forcing the developer to manually translate sequential code into continuation passing style.

Parallelism: In the Cloud, Cluster and Client
http://blogs.msdn.com/b/amit_chatterjee/archive/2010/12/19/parallelism-in-the-cloud-cluster-and-client.aspx
Software and digital experience is now becoming ubiquitous in our lives. Software is everywhere – it is stocking supermarket shelves, delivering electricity and water to our homes, storing our personal information in computers around the world, running nuclear plants and even controlling doomsday weapons! Moreover, with the popularity of the Internet and mobile devices, and with the advances in graphical and natural user interfaces, the creative human minds and the innovative companies are making the digital age more personal, social and indispensible.
This is leading to three fundamental trends in the world today:
Data explosion – the phenomenal growth of raw digital data
Demand for computational power for transforming raw data into meaningful information
Exponential growth in the number of users getting on to the digital super highway

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

More links are coming.

Keep tuned!

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

Metaprogramming: Links, news and resources (1)

As a programming language fan and writer of many interpreters, I’m interested in metaprogramming. Some links I found useful:

http://en.wikipedia.org/wiki/Metaprogramming

Metaprogramming is the writing of computer programs that write or manipulate other programs (or themselves) as their data, or that do part of the work at compile time that would otherwise be done at runtime. In some cases, this allows programmers to minimize the number of lines of code to express a solution (hence reducing development time), or it gives programs greater flexibility to efficiently handle new situations without recompilation.

magarciaEPFL / MethodHandleUtils
https://github.com/magarciaEPFL/MethodHandleUtils
JVM: Composing MethodHandles at runtime like AST nodes
Runtime metaprogramming via java.lang.invoke.MethodHandle
http://lampwww.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/2012Q2/RuntimeMP.pdf

Ruby Metaprogramming: Declaratively Adding Methods to a Class
http://www.vitarara.org/cms/ruby_metaprogamming_declaratively_adding_methods_to_a_class

dlitvakb / MetaBuilder
https://github.com/dlitvakb/MetaBuilder
A Ruby MetaProgramming Excercise

Adding Properties to Ruby Metaprogramatically
http://www.infoq.com/articles/properties-metaprogramming

Ruby: More About Methods
http://ruby-doc.org/docs/ProgrammingRuby/html/tut_methods.html

Calling Methods Dynamically
http://www.linuxtopia.org/online_books/programming_books/ruby_tutorial/Reflection_ObjectSpace_and_Distributed__Ruby_Calling_Methods_Dynamically.html

Ruby dynamic method calling
http://khelll.com/blog/ruby/ruby-dynamic-method-calling/

celluloid / celluloid
Actor-based concurrent object framework for Ruby

MetaProgramming – Extending Ruby for Fun and Profit
http://www.infoq.com/presentations/metaprogramming-ruby

Three implicit contexts in Ruby
http://yugui.jp/articles/846
Yehuda Katz wrote an article about self and metaclass. In the article he said that Person.instance_eval assigns Person’s metaclass to self for a class Person. But this is obviously wrong.
Ruby always has three implicit contexts: self), so called `klass’ and the constant definition point.

Metaprogramming in Ruby: It’s All About the Self
http://yehudakatz.com/2009/11/15/metaprogramming-in-ruby-its-all-about-the-self/

class << self idiom in Ruby
http://stackoverflow.com/questions/2505067/class-self-idiom-in-ruby

ClassInstanceVariable
http://martinfowler.com/bliki/ClassInstanceVariable.html

Default Ruby accessor method?
http://stackoverflow.com/questions/636277/default-ruby-accessor-method
method_missing; it gets called whenever an undefined method is used

A Logic Meta-Programming Approach
to Support the Co-Evolution of
Object-Oriented Design and Implementation
http://scg.unibe.ch/archive/phd/Wuyts-phd.pdf

Meta-level Programming with CodA
http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.108.6885

C#5 and Meta-Programming
http://codebetter.com/patricksmacchia/2010/05/31/c-5-and-meta-programming/

Metaprogramming in .NET
http://www.manning.com/hazzard/

Whole Platform
http://whole.sourceforge.net/
the Whole Platform provides an Eclipse-based Language Workbench for developing new languages, manipulating them using domain notations and transforming them using a generative model driven approach.

Code Generation on the JVM: Writing Code that Writes Code
http://www.infoq.com/presentations/Code-Generation-on-the-JVM

Rascal – Meta Programming Language
http://www.rascal-mpl.org/
Rascal is a domain specific language for source code analysis and manipulation a.k.a. meta-programming.

Write A Template Compiler For Erlang
http://evanmiller.org/write-a-template-compiler-for-erlang.html
Implementing the Django Template Language in Erlang

Groovy: Best Practices Developed From Distributed Polyglot Programming
http://www.infoq.com/presentations/Groovy-Best-Practices

The Magnificent Seven
http://fogus.me/static/preso/magnificent7/#slide1
creating a Lisp variant in seven forms

The calculator language tutorial
http://www.jetbrains.com/mps/docs/tutorial.html

The art of metaprogramming, Part 1: Introduction to metaprogramming
http://www.ibm.com/developerworks/linux/library/l-metaprog1/index.html
One of the most under-used programming techniques is writing programs that generate programs or program parts. Learn why metaprogramming is necessary and look at some of the components of metaprogramming (textual macro languages, specialized code generators). See how to build a code generator and get a closer look at language-sensitive macro programming in Scheme.

Through the Looking Glass Darkly
http://gbracha.blogspot.com.ar/2010/03/through-looking-glass-darkly.html
The classic approach to reflection in object-oriented programming languages originates with Smalltalk, and is used in most class based languages that support reflection: define a reflective API on Objec
nother approach is used in many scripting languages. The language constructs themselves introduce code on the fly, modifying the program as they are executed.
The third approach is that of mirrors, and originates in Self. Mirrors have been used in class based systems such as Strongtalk, and even in the Java world. JDI, the Java Debugger Interface, is a mirror based reflective API. Here, the reflective operations are separated into distinct objects called mirrors.

Mirrors: Design Principles for Meta-level Facilities of Object-Oriented Programming Languages
http://www.bracha.org/mirrors.pdf

Metaprogramming: Ruby vs. Javascript
http://fingernailsinoatmeal.com/post/292301859/metaprogramming-ruby-vs-javascript

Metaprogramming in Ruby
http://ruby-metaprogramming.rubylearning.com/

A Basic YAML Config Module For Ruby
http://lostechies.com/derickbailey/2009/10/05/a-basic-yaml-config-module-for-ruby/

Categories, the homemade object system
http://lambda-the-ultimate.org/node/3569

Categories
http://mikelevins.livejournal.com/3678.html

Why? Language Archaeology … and Metaprogramming
http://www.artima.com/weblogs/viewpost.jsp?thread=260578

Metaclasses Demystified
http://cleverdevil.org/computing/78/
The word “metaclass” often strikes fear into the hearts of Python programmers. This article explores metaclasses in an approachable way, in order to take the mystery out of metaclasses, and enable you to leverage metaprogramming techniques to solve real problems.

Dupping Our Way Out of Instance Eval
http://banisterfiend.wordpress.com/2008/12/19/dupping-our-way-out-of-instance-eval/

Ruby.rewrite(Ruby)
http://www.infoq.com/presentations/braithwaite-rewrite-ruby
In this RubyFringe talk, Reginald Braithwaite shows how to write Ruby that reads, writes, and rewrites Ruby. The demos include extending the Ruby language with conditional expressions, new forms of evaluation such as call-by-name and call-by-need, and more.

Smalltalk magritte-metamodel
http://code.google.com/p/magritte-metamodel/
Magritte is a fully dynamic meta-description framework that helps to solve those problems, while keeping the full power to the programmer in all aspects.

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

More links about DLSs, programming languages, and metaprogramming are coming.

Keep tuned!

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