Bluish Coder

Programming Languages, Martials Arts and Computers. The Weblog of Chris Double.

Posts tagged “proglang”

263 posts

Fun Factor Libraries

Factor is a programming language I've written about before and in the early days of Factor development I wrote a number of libraries and contributed to development. It's been a while since I've contributed but I still use Factor. The development environment has a very Smalltalk-like feel to it and it includes full documentation and browseable source code of libraries.... more →

Defining Types in Shen

The Shen programming language has an extensible type system. Types are defined using sequent calculus and the system is powerful enough to create a variety of exotic types but it can be difficult when first starting with Shen to know how to use that power. In this post I hope to go through some basic examples of defining types in... more →

Getting Started with Mercury

Mercury is a logic programming language, similar to Prolog, but with static types. It feels like a combination of SML and Prolog at times. It was designed to help with programming large systems - that is large programs, large teams and better reliability, etc. The commercial product Prince XML is written in Mercury. I've played around with Mercury in the... more →

Generalized Algebraic Data Types in ATS

The ATS programming language supports defining Generalized Algebraic Data Types (GADTS). They allow defining datatypes where the constructors for the datatype are explicitly defined by the programmer. This has a number of uses and I'll go through some examples in this post. GADTs are sometimes referred to as Guarded Recursive Datatypes. Some useful resources for reading up on GADTs that... more →

Concurrent and Distributed Programming in Web Prolog

SWI Prolog is an open source Prolog implementation with good documentation and many interesting libraries. One library that was published recently is Web Prolog. While branded as a 'Web Logic Programming Language' the implementation in the github repository runs under SWI Prolog and adds Erlang style distributed concurrency. There is a PDF Book in the repository that goes into detail... more →

Capturing program invariants in ATS

I've been reading the book Building High Integrity Applications with Spark to learn more about the [SPARK/Ada](https://en.wikipedia.org/wiki/SPARK_(programming_language)) language for formal verification. It's a great book that goes through lots of examples of how to do proofs in Spark. I wrote a post on Spark/Ada earlier this year and tried some of the examples in the GNAT edition. While working through... more →

Casting in ATS

The ATS programming language has a powerful type and proof system to enable safe construction of programs. Sometimes there is a need to cast a value from one type to another. ATS provides a feature that enables the programming to write their own rules specifying what can be cast. This becomes important when converting types from non-dependent typed values to... more →

Cross Compiling ATS Programs

A few years ago I wrote a mailing list post on cross compiling ATS to Android. With ATS2 being released the ability to cross compile has been made easier. In this post I'll show how to produce static linux binaries using musl libc and how to build Android and Windows ATS programs by cross compiling on linux. For these examples... more →

Using the J Foreign Function Interface

The J Programming Language is an array oriented or vector based programming language. It is in the same family of programming languages as [APL](https://en.wikipedia.org/wiki/APL_(programming_language)) and [K](https://en.wikipedia.org/wiki/K_(programming_language)). I won't be going into deep details of J syntax or a tutorial of how to use it in this post - for that I recommend something like J for C Programmers which is... more →

Reference Capabilities, Consume and Recover in Pony

I've written about reference capabilities in the Pony programming language spread across some of my other posts but haven't written about them directly. This post is my attempt to provide an intuitive understanding of reference capabilities and when to use consume and recover. Hopefully this reduces the confusion when faced with reference capability compilation errors and the need to memorize... more →

Runtime typing and eval in Alice ML

I originally wtote this post three years ago but I wasn't happy with how it read so never finished it. It's been sitting around in draft making me feel guilty for too long so I've cleaned it up and published it. I like the style of prototyping and programming that dynamic languages like Self promote. When building systems inside the... more →

Installing GNAT and SPARK GPL Editions

GNAT is an implementation of the Ada programming language. SPARK is a restricted subset of Ada for formally verifying programs. It provide features comparable to languages like Rust and ATS. A recent article comparing SPARK to Rust caught my eye and I decided to spend some time learnig Ada and SPARK. This post just outlines installing an implementation of both,... more →

Borrowing Internal Pointers in ATS

Recently Robert O'Callahan wrote a post on what Rust can do that other languages can't. It involves getting a pointer to an internal field of a stack allocated object and having the type system ensure that the lifetime of that pointer doesn't outlive the owning object. As soon as I saw this I thought "Aha, ATS can do that!" but... more →

Transitioning from ATS1 to ATS2

ATS is a programming language I've used a lot in the past. A new version was released a while ago, ATS2, that resulted in various library and language changes and I never got around to transitioning my code to it. Many of my existing posts on ATS are still relevant but some syntax has changed and many of my examples... more →

Concurrency in Wasp Lisp

Wasp Lisp has a light weight co-operative threading model that's allows programming in an Actor style. It's possible to serialize Wasp values and send them to other processes and machines to be deserialized and run. MOSREF uses this to compile Lisp code on the console process and send the bytecode to drone processes to execute. This allows drones to operate... more →

Building Static Wasp Lisp Binaries on Linux

Wasp Lisp builds binaries that are linked dynamically to glibc. This ties the binary to specific versions of Linux. It's usually not possible to run on an OS with older glibc versions than what it was compiled against. I wanted to be able to run a single binary of Wasp Lisp and MOSREF drones on new Ubuntu versions and some... more →

Exploring actors in Pony

Pony is an actor oriented programming language. In Pony Actors are objects that can send and receive messages asychronously while processing their received messages sequentially and in parallel with other actors processing their messages. They are the unit of concurrency in the language. Each actor is similar to a lightweight thread of execution in languages that support those. For background... more →

Bang, Hat and Arrow in Pony

If you've looked at Pony programming language code you've probably seen use of punctuation symbols in places and wondered what they meant. This post is an attempt to explain three of those - the bang, hat and arrow (!, ^ and -> respectively). Note that this is my understanding based on usage, reading the tutorials and watching videos so there... more →

Closures in Pony

Note 2017-08-01: Recent releases of Pony have changed syntax for lambda calls and partial function calls. This post has been updated to work with these changes as of Pony 0.16.1. The Pony programming language has support for closures but the documentation hasn't caught up with changes to the implementation. This post describes some of the features of Pony closures with... more →

Cross compile Pony programs for Android

Support for compiling Pony programs on ARM and 32-bit x86 landed recently. This allows compiling and running Pony on Raspberry Pi and other ARM devices. I was curious if it would be possible to compile Pony programs to run on Android and this post outlines how I got a "Hello World" example working. The Pony compiler, ponyc, does not currently... more →

C linkable libraries with Pony

Note 2017-08-01: Recent releases of Pony have changed some of the details of interacting with C. This post has been updated to work with these changes as of Pony 0.16.1. My quick look at Pony post covered how to use the FFI to call C code from a Pony program. It's also possible to compile Pony code to a C... more →

Demo of programming in Self

The Self programming language has a GUI environment which can be a bit intimidating to people new to the system. The Self Handbook covers it but it's difficult to convey usage with text and static images. I've created a video that demonstrates how to develop in Self using the GUI to create a 'bank account' object and manipulate it. The... more →

A quick look at the Pony Programming Language

Pony is a new programming language described on their site as "an open-source, object-oriented, actor-model, capabilities-secure, high performance programming language." It has some interesting features and is different enough to existing popular programming languages to make it a nice diversion to experiment with. Some features include: more →

Building Erlang for Android

Support for building Erlang on Android is provided in the standard Erlang source. # Build setup I use the Erlang git version for building. Cloning can be done with: git clone https://github.com/erlang/otp more →

Contributing to Servo

Servo is a web browser engine written in the Rust programming language. It is being developed by Mozilla. Servo is open source and the project is developed on github. I was looking for a small project to do some Rust programming and Servo being written in Rust seemed likely to have tasks that were small enough to do in my... more →

Spawning Windows Commands in Wasp Lisp and MOSREF

It's been a while since I last wrote about MOSREF and Wasp Lisp. MOSREF is the secure remote injection framework written in Wasp Lisp. It facilitates penetration testing by enabling a console node to spawn drone nodes on different machines. The console handles communication between nodes and can run lisp programs on any node. The console can execute programs on... more →

Improving Linux Font Support in Self

In the Linux version of the Self programming language implementation the fonts used are standard X11 fonts. On modern Linux systems these don't look great and a common question asked in the mailing list is how to improve it. Fonts on the Mac OS X build of Self use a different system and they look much better. It would be... more →

Self Benchmarking

I was asked on twitter about the current speed of the Self implementation. The request was for a method send benchmark so I wrote a simple one and compared against Pharo, a Smalltalk implementation. The implementation and technology behind Self is quite old in comparison to modern compiler implementations but at the time it was state of the art. I... more →

Changing Attributes in Self objects

A question came up in the Self irc channel today about how to change the 'comment' string for an object. Comments are stored as attributes on an object. These are accessed using mirrors. A mirror for an object can be obtained using the asMirror method. The trait traits mirrors abstractMirror provides a number of methods that can be used to... more →

Revisiting Alice ML

Alice ML is a functional programming language base on Standard ML with extensions to support concurrent and distributed programming. I first got interested in it back in 2004 when version 1.0 was released and used it on and off for a couple of years until development stalled. It's hard to believe that ten years has passed since that post! A... more →

PicoLisp on Android

PicoLisp is a small Lisp interpreter that tries to stay true to the path of 'code is data' as much as possible. It has some nice features, including a persistent database and built in prolog engine. The system is quite reflective and this is shown in the way you can use vim to browse the live system. There is a... more →

Preventing heartbleed bugs with safe programming languages

The Heartbleed bug in OpenSSL has resulted in a fair amount of damage across the internet. The bug itself was quite simple and is a textbook case for why programming in unsafe languages like C can be problematic. As an experiment to see if a safer systems programming language could have prevented the bug I tried rewriting the problematic function... more →

Multiple Users in a Self World

One of the things I like about the Self programming language is it has lots of interesting old projects written in Self included in the source distribution. These include a Dylan interpreter, Cecil interpreter, web browser, and partial Java implementation amongst other things. Once of the features Self has is the ability to allow remote users to connect to a... more →

Running the Self Programming Language on Android

I've written about the Self programming language before and still occasionally fire up the GUI environment to explore prototype object development. The Self implementation is JIT based and doesn't have an interpreter. I've wanted to have the Self environment running on a mobile device but most tablets and phones are ARM based and Self doesn't have an ARM backend. Intel... more →

Phantom Types in Rust

Update 2013-08-16, I've updated the first example based on feedback from the hacker news, /r/rust, and /r/programming threads. I attended an overview of how the Servo browser engine, written in the Rust programming language, implements the task of laying out of elements on a web page. Patrick Walton gave the talk and highlighted some of the implementation idioms in Servo.... more →

Linking and calling Rust functions from C

At a recent functional programming meetup I was discussing with a colleague about how nice it would be to be able to use Rust in Gecko. This made me curious if it was possible to implement libraries in Rust and call them from C. After the meeting I asked in #rust and got pointed to some projects that showed the... more →

Constructing Proofs with dataprop in ATS

My last post that covered using proofs in ATS implemented a stack. In this post I step back a bit and go through some smaller examples using dataprop with proofs using prfun. The examples I work through here are based on the Propositions and Evidence section of Software Foundations. That book covers the Coq Proof Assistant and I've been working... more →

Building Wasp Lisp and MOSREF for Android

Wasp Lisp is a small cross platform lisp by Scott Dunlop that I've written about before and MOSREF is the secure remote injection framework that is one of the applications written with it. I've been wanting to get Wasp running on Android and Gonk (the low level Android layer of Firefox OS) for debugging and small applications. One of the... more →

Ranged integer types and bounds checking

There's a discussion going on in the Rust mailing list about ranged integer types and whether they're useful for safety. Some of the points raised have been about the performance costs of dynamic bounds checks and the overhead of code for static bounds checks. I thought I'd write a post with my experiences with overfow checking in Gecko and with... more →

An Introduction to using pointers in ATS

The ATS programming language was designed to enable safe systems programming. This requires dealing with pointers safely. In this post I intend to go through the basics of pointer handling in ATS and how this safety is achieved. # Raw Pointers ATS has a basic pointer type called ptr. This is a non-dependent type and is the equivalent to a... more →

Implementing a stack with proofs in ATS

This post works through an example of a stack datatype, adding ATS features as we go along to help prove the implementation is correct. The example starts with a simplified stack of integers. I then add some dependent types to improve checking of the implementation and follow this with dataprop usage for more extensive compile time checking. I use datatype... more →

Safer handling of C memory in ATS

In previous ATS posts I've written about how ATS can make using C functions safer by detecting violations of the C API's requirements at compile time. This post is a walkthrough of a simple example which involves a C api that copies data from a buffer of memory to one allocated by the caller. I'll start with an initial attempt... more →

Lightweight Tasks Library for ATS

I've been using libevent a fair bit recently from my systems developed in the ATS programming language. The resulting code is callback oriented and this programming style can result in difficult to follow code. Recently I ported a python programming using the twisted asynchronous network library to ATS and the callbacks were getting hard to manage. An example of the... more →

ATS library reference

While I had some downtime travelling during my Pitcairn Island trip I made a start at writing some reference documentation for some of the ATS standard libraries. I used AsciiDoc to write the documentation because I was familiar with it from doing a reference for Wasp Lisp. I've only documented a few of the standard modules and welcome contributions for... more →

Pattern Matching Against Linear Objects in ATS

In a project I'm working on I'm using linear lists. This is the list_vt type in the ATS prelude. list_vt is similar to the list types in Lisp and functional programming languages except it is linear. The memory for the list is not managed by the garbage collector and the type system enforces the rule that only one reference to... more →

Using Records and C structs in ATS

ATS has record types which are like tuples but each item is referenced via a name. They closely approximate C structs and in the generated C code are represented in this way. The following uses a record to hold x and y values representing a point on a 2D plane: fun print_point (p: @{x= int, y= int}): void = printf("%d@%d\n",... more →

Building Rust

Update 2011-11-08 - The steps to build Rust have changed since I wrote this post, there's now no need to build LLVM - it's included as a submodule in the Rust git repository and will automatically be cloned and built. A while ago I wrote a quick look at Rust post, describing how to build it and run some simple... more →

Overloading Functions in ATS

ATS allows overloading of functions where the function that is called is selected based on number of arguments and the type of the arguments. The following example shows overloading based on type to provide a generic print function: symintr myprint fun myprint_integer (a: int) = printf("%d\n", @(a)) fun myprint_double (a: double) = printf("%f\n", @(a)) fun myprint_string (a: string) = printf("%s\n",... more →

Safe destruction in the presence of sharing in ATS

While using the libevent API from ATS I came across a scenario where it was important to call a function to release objects in a particular order. I wanted to have ATS enforce at compile time that the destruction occurs safely in the right order. The following example uses the built in libevent HTTP API for creating simple web servers.... more →

Building Mozart/Oz on Windows

The Mozart Programming System is an implementation of the Oz programming language. It's the language used in the book Concepts, Techniques, and Models of Computer Programming by Peter Van Roy and Seif Haridi. From the Mozart website: more →

Sharing Linear Resources in ATS

My previous post on converting C programs to ATS had an example of passing a linear resource to a callback function. The code looked like: typedef evhttp_callback (t1:viewtype) = (!evhttp_request1, !t1) -<fun1> void extern fun evhttp_set_cb {a:viewtype} (http: !evhttp1, path: string, callback: evhttp_callback (a), arg: !a): int = "mac#evhttp_set_cb" ... val _ = evhttp_set_cb {event_base1} (http, "/quit", lam (req, arg)... more →

Converting C Programs to ATS

I tend to use ATS as a low level programming language - a better, safer, C. Often I start with a C program and slowly add ATS features as I go. I do this so I can utilize existing C code, write my higher level functionality in ATS, and slowly convert parts of the C to ATS to add compile... more →

A Quick Look at the Rust Programming Language

The Rust Programming Language is a systems programming language being developed by Mozilla. It was announced last year and has seen quite a bit of development since then. I've only been lightly following the development over the past year but recently decided to spend a bit more time looking at it. The following is a look at the language and... more →

Linear Datatypes in ATS

A datatype in ATS is similar to types defined in languages like ML and Haskell. They are objects allocated in the heap controlled by the garbage collector. The programmer does not need to explicitly free the memory or manage the lifetime of the object. A dataviewtype is similar to a datatype in that it is an object allocated on the... more →

Reading data from a file in ATS

I'm back to using the ATS programming language after a bit of a break. My first thought upon getting back into the language is how easy it is to forget how to write in a language you don't use often. It's starting to come back to me though. For my current task I needed to read string data from a... more →

WebM Decoder in Flash using Alchemy

Ralph Hauwert has been posting on twitter about work he's done on getting WebM decoding to work in Flash by compiling the libvpx source code using Adobe's Alchemy technology. Alchemy is a research project that allows compilation of C and C++ libraries into code that runs on the ActionScript virtual machine used by Flash. Ralph originally tweeted: more →

Wasp Lisp Respository Moves to Github

Scott Dunlop, The author of Wasp Lisp, has moved development from its bzr based launchpad location to WaspVM on github. Hopefully this will encourage more interest in the implementation with people forking and working on it. For an overview of Wasp Lisp you can read a couple of my previous posts on it: more →

Handling POST requests with Ur/Web

Ur/Web makes it easy to write web applications that have HTML forms and handle the posted data. It gets a bit trickier if you have a POST handler that does not have an HTML form in the web application but is instead called by an external service. The following is a function that handles a POST request field containing a... more →

Simple Ur/Web Example

I've been admiring Ur/Web from afar for a while now and I've decided to dive into it and try it out on a project. Ur/Web is described at the website as: more →

More on type safety using C and ATS

I wrote previously about using the ATS programming language to safely use C libraries. I've recently been using ATS in a couple of projects and have had to access a few more C libraries. This post goes through a few more ways ATS can be used to make it harder to incorrectly use C libraries by making some classes of... more →

Dependent Types in ATS

Dependent types are types that depend on the values of expressions. ATS uses dependent types and in this post I hope to go through some basic usage that I've learnt as I worked my way through the documentation, examples and various papers. While learning about dependent types in ATS I used the following resources: more →

Concurrency in ATS

ATS uses native operating system threads for concurrency. It provides a wrapper around pthreads and a higher level API for creating worker threads and using them for parallel computation called 'parworkshop. 'parworkshop' is described in a mailing list announcement about it as: more →

lin and llam with closures

While using the ATS wrapper for pthreads I noticed the use of a couple things related to closures that I hadn't seen before and therefore didn't get mentioned in my post on ATS closures. The signature for the function to spawn a closure in a thread is: fun pthread_create_detached_cloptr (f: () -<lin,cloptr1> void): void // end of [pthread_create_detached_cloptr] more →

Closures in ATS

My last post on ATS was about C style functions. This post covers what I've learnt about closures in ATS. As I mentioned in my last post, closures are functions combined with an environment mapping names to values. These are like closures in dynamic languages that enable you to capture variables in the enclosing scope. To create a closure you... more →

Functions in ATS

Using higher order functions in ATS was a bit of a struggle for me at first due to having to deal with getting types correct. I'm coming from a background of dynamically typed languages where it is easy to create and pass around anonymous functions. Even other typed languages like Haskell proved easy to pick up, primarily because of the... more →

Safer C Code Using ATS

When developing the original Ogg backend for Firefox we had to integrate and use a number of C libraries. Over the months after landing a number of bugs were raised for various issues in the backend. A fair number of these were the result of common coding errors. Things like not checking return values of the C API calls and... more →

ATS Preforking Echo Server

As an exercise in learning more about ATS I worked on porting the preforking echo server I wrote in Pure. I wanted to get a feel for how higher order functions worked so I followed the same structure as the Pure program. The code I ended up with is in preforking1.dats. There is also a pretty-printed version produced by 'atsopt'.... more →

Vorbis Player implemented in Pure

After writing the preforking echo server example in Pure I wanted to try something a bit more complex. I've written Ogg players in various languages before so I decided to do one in Pure to compare. Here's some of the ones I've written in the past: more →

Dealing with my archived Blogger posts

I've stopped using Blogger for the weblog and have moved to using Jekyll. I've set things up so I can edit the posts on my local push, push to my server using git and it publishes the new post. Blogger provides a way to export all existing posts and comments as an XML file. I used this to manually import... more →

Using the Wasp Lisp Secure Remote Injection Framework (MOSREF)

MOSREF is a secure remote injection framework written in Wasp Lisp (which I previously wrote about here). With MOSREF you have a 'console' program running which can create dones applications that are run on a target system. The console and drones can communicate with each other, executing shell commands or Wasp Lisp code. Drones can create other drones to 'bridge'... more →

Wasp Lisp - a Small Scheme-like Lisp

Wasp Lisp is a small Scheme-like Lisp implementation developed by Scott Dunlop. It features a lightweight concurrency model (with similarities to Erlang and Termite). Wasp Lisp was originally derived from MOSREF - the Mosquito Secure Remote Execution Framework. It includes an implementation of MOSREF so can do similar things that the original was built for. Wasp feels a lot like... more →

Displaying images with Self

The Self source code has some example programs, one of which is a web browser. This was developed quite a long time ago and is unable to nicely display most pages on the modern web but it does a reasonable job of basic pages. On the Linux port there were some problems with displaying images however. I tracked this down... more →

Building and using Self on Linux

The original implementation of the Self programming language is easy to build from source. Russell Allen maintains a git repository on github containing the source. I use Arch Linux with 'flex' and 'tcsh' packages installed for various parts of the build process. To build a Self binary: $ git clone git://github.com/russellallen/self.git $ cd self/release $ sh buildLinuxVM $ cd ..... more →

Prototype Based Programming Languages

I've been reading up on protoype based programming languages recently. Mainly using the Io Programming Language and Self but also looking at LambdaMOO and similar languages. A good overview of using the prototype based approach to building programs is Organizing Programs without Classes. This post is based on examples from that paper and from Attack of the Clones which covers... more →

Reading Ogg files with JavaScript

On tinyvid.tv I do quite a bit of server side reading of Ogg files to get things like duration and bitrate information when serving information about the media. I wondered if it would be possible to do this sort of thing using JavaScript running in the browser. The format of the Ogg container is defined in RFC 3533. The difficulty... more →

Simple Nanojit Example

I've been playing around with Nanojit, thinking about using it in a toy project of mine. Nanojit is a library for generating machine code with backends for x86 and ARM. It's used by Tamarin and TraceMonkey for their just in time compilers. The Mozilla documentation contains some documentation which gives an overview of what's there: more →

File Uploads with HAppS

I've updated the Not a HAppS Tutorial cookbook with an example of how to handle file uploads using file input types in forms. Next step is to take a look at how sessions and session data is handled. more →

Not a Tutorial on HAppS

A long time ago I took a look at HAppS, a Haskell web application framework. I recently got the excellent book Real World Haskell and have been working through the book. I wanted something to explore while doing this so I revisited HAppS to play around with web programming in Haskell. There's some documentation out there on HAppS, compared to... more →

Dynamic Compilation and Loading of Modules in Haskell

The Haskell system GHC has libraries that provide the ability to compile Haskell code and dynamically load it into a running Haskell program. A library that provides this functionality is hs-plugins. Unfortunately hs-plugins doesn't work with the latest GHC release, 6.10.1. There is an API to the internals of GHC that allows implementing runtime compilation and loading. The api is... more →

Revisiting the Linear recursion combinator in Factor four years on

The Joy programming language has a linrec combinator for performing linear recursion. Some time ago I took a stab at implementing linrec in Factor. Slava also posted his version that was originally a part of Factor. As can be seen from Slava's version, juggling the stack when four quotations are involved can be problematic. I thought I'd revisit linrec using... more →

The Left Fold Enumerator for i/o

There have been some interesting papers and talks about approaches to handling i/o using left folds recently. First was the galois tech talk about a safe and efficient i/o interface in Haskell using left fold enumerators. PDF slides are here. The example web server, Hyena, is available on github. Oleg Kiselyov then gave a talk at DEFUN about using left... more →

Factor Web Framework Example

The Factor web framework was recently redeveloped and my previous post on the topic is out of date. I'm re-learning how to write Factor web applications as I work through a simple app I'm building. At first I was overwhelmed by the large number of features in the new framework, but once I got a bit of an understanding I... more →

JavaScript Space Invaders Emulator

Ajaxian recently posted about a fun JavaScript implementation of PacMan. After spending way too much time on it I wondered how well an emulation of the old arcade game hardware would go in JavaScript. I've written a few 8080 arcade game emulations before in different languages so I had a go at implementing it in JavaScript. You can try the... more →

Parsing JavaScript with Factor

I've made some more changes to the Parsing Expression Grammar library in Factor. Most of the changes were inspired by things that OMeta can do. The grammar I used for testing is an OMeta-JS grammar for a subset of JavaScript. First the list of changes. Actions in the EBNF syntax receive an AST (Abstract Syntax Tree) on the stack. The... more →

Extending Tamarin Tracing with Forth

My previous article on extending Tamarin Tracing with native methods described how to implement the native methods in C. It's also possible to implement native methods in Forth. Methods implemented in JavaScript are compiled to ABC bytecode by a compiler (currently the asc.jar provided by the Flex SDK). These are compiled to the basic Forth instructions by the Tamarin Tracing... more →

A Quick Introduction to Tamarin Tracing

2008-05-20: Fixed some breakage due to changes to the latest Tamarin Tracing source, and updated more recent timing. I attended the Tamarin Tech summit at Adobe on Friday. My main interest for attending was to learn more about the tamarin-tracing project. The goal of Tamarin is to produce a high performance ECMAScript 4 implementation. 'Tamarin Tracing' is an implementation that... more →

Implementing Native Methods in Tamarin Tracing

2008-05-20: Minor update to get things working with latest Tamarin Tracing code, and updated times for test runs. Tamarin Tracing can be extended by creating native methods. These are methods of a class where the implementation is in C rather than JavaScript. For this example I'll use a native implementation of the fibonacci function and compare it to the JavaScript... more →

Factor Parsing DSL

I've been doing some experimenting with the emedded grammar code I wrote for Factor, trying to make it easier to use and a bit more useful for real world projects. My inspiration for the changes has been seeing the kinds of things OMeta can do and the examples in the Steps towards the reinvention of programming from the Viewpoints Research... more →

Collection of Factor Articles in PDF

Factor has experienced some rapid change in the libraries and language over the past few years. I've written a few blog posts about Factor in the past and many of them suffer from bitrot due to this, making it hard to try out the examples in the latest Factor versions. I've collected some of these articles, put them in a... more →

Building the ActionScript compiler for Tamarin

Adobe have released the Flex SDK as open source. The trunk of the SDK repository contains the source to the ActionScript compiler and the GlobalOptimizer component that can be used for generating code used in Tamarin Tracing. To build the asc.jar required by Tamarin, first get a copy of the current source, change to the 'modules/asc/build/java/' directory and run 'ant'... more →

Embedded Grammars in Factor

I'm working on a new parser combinator library for Factor based on Parsing Expression Grammars and Packrat parsers. This is based on what I learnt from writing a packrat parser in Javascript. It's progressing quite well and already fixes some problems in the existing parser combinator library I wrote. The main issue with that one is it's not tail recursive... more →

Writing Web Applications in Factor

There was a request on #concatenative for information on how to write web applications in Factor. I went through a few steps on how to get started. I'm repeating it here for others that might be interested. There are a number of different ways of writing web applications in Factor but for this approach I'm using the furnace framework. The... more →

Javascript Packrat Parser

I've made some changes to my parser combinator library written in Javascript that I wrote about previously. I was extending the example code from that post to parse more of the ECMAScript 3 grammar to test it out and was hitting performance issues. I ended up modifying the combinator library to be a Packrat style parser. The Parsing Expression Grammar... more →

Javascript Parser Combinators

Cleaning up my hard drive I came across some old libraries I'd written. One of them was a simple set of parser combinators written in Javascript. I put it in a git repository in case they prove useful to someone: git clone git://github.com/doublec/jsparse.git more →

Standard ML to Javascript compiler

smltojs is a compiler from Standard ML to Javascript. According to the page it has support for all of Standard ML. Since the reference implementation of Ecmascript 4 is written in Standard ML it would be interesting to see if it can be built using this compiler. That would provide an es4 implementation that runs in the browser based off... more →

How to publish a Git repository

This post is aimed mainly at Factor developers who need to make their repository accessible to Slava to retrieve patches. Factor has recently moved to using git as the version control system. To set up a repository on a server you should clone the existing Factor repository using the '--bare' option: git clone --bare http://www.factorcode.org/git/factor.git factor.git more →

Vodka - An Interesting Concurrent Language

Recently on Lambda the Ultimate there was an announcement about the Vodka programming language. The language is a masters thesis project by Tiark Rompf and has some interesting ideas. It is designed to be a concurrency oriented language, based on the ideas of Join Calculus and Petri Nets. It has multimethod dispatch (like CLOS, Dylan and Nice), generators and many... more →

Distributed Channels in Factor

Following on from my Channels implementation, I've now added 'Remote Channels'. These are distributed channels that allow you to access channels in separate Factor instances, even on different machines on the network. It's based on my Distributed Concurrency work. A channel can be made accessible by remote Factor nodes using the 'publish' word. Given a channel this will return a... more →

Concurrent Channels for Factor

Rob Pike gave a talk at Google about the NewSqueak programming language, and specifically how it's concurrency features work. NewSqueak uses channels and is based on the concepts of Communicating Sequential Processes. To play around with some of the ideas in the video I created a quick implementation of channels for Factor and converted a couple of the NewSqueak examples.... more →

Using the Factory Window Manager on Mac OS X

Factory is an X11 window manager written in Factor by Eduardo Cavazos. Although best used in Linux, it can also be run using the X11.app in Mac OS X. First you need to build Factor using the X11 backend rather than the standard Mac OS X backend. This can be done with the latest darcs code using these steps: cd... more →

Javascript on the Server

Running Javascript on the server seems to be gaining in popularity. Last year I wrote a small framework to test writing web applications in Javascript. Tony Garnock-Jones later extended this to support building continuation based web applications. More recently, Peter Michaux has taken my original code and made a nicer web framework out of it. John Resig has written a... more →

ECMAScript Edition 4 Reference Implementation

Brendan Eich has posted about the availability of a reference implementation of ECMAScript Edition 4. ECMAScript Edition 4 is the new version of Javascript being designed. The reference implementation is written in SML (Standard ML). More information is at the Lambda The Ultimate posting about it. more →

Asynchronous Javascript

Ajaxian has a post about a new abstraction based around the recent Google Gears API for executing Javascript asynchronously. What the Google Gears API provides is the ability to execute Javascript in a different browser thread, and to communicate with those threads via simple message passing. The new abstraction referenced in the Ajaxian post expands on this to allow registering... more →

A mix of many things

I haven't been blogging much about what I've been doing lately so here's my attempt to put lots of little things in one post. Work at Mozilla is going well. My patches for Firefox related to offline event notifications were reviewed and committed to CVS. Offline support is now in the nightly builds and can be used. I finished the... more →

Ogg Theora support for Factor

A month or two back I did more work on my Ogg bindings for Factor. I didn't blog about it but I added Ogg Theora playback support and moved the Vorbis playback into a generic 'ogg-player' application written in Factor. This is now in the standard Factor distribution. You can play Theora video files by loading the apps/ogg-player module and... more →

Factor Article Manager Source

At the beginning of the year I wrote an 'Article Manager' web application in Factor. The idea was to have a simple way of writing short articles and snippets of information, that could be tagged and navigated. I wanted something small and easy to use, suited for this purpose. In about 8 hours I threw together the article manager and... more →

Factor Space Invaders Updated

I've updated my space invaders emulator written in Factor to work with the new Factor GUI system. This means that Space Invaders can run in a seperate window from the main Factor GUI and you can even run multiple instances at a time. While the emulator is running you can still use the Factor GUI to browse, run code, etc.... more →

Ogg Vorbis support for Factor

I've implemented Ogg Vorbis playback in Factor. The library is in the module 'libs/vorbis' and supports playing Vorbis encoded audio from .ogg files and streams: "test.ogg" play-vorbis-file "http://www.bluishcoder.co.nz/test.ogg" http-get* [ play-vorbis-stream ] keep stream-close more →

Dynamic Code Generation and Image Files

An image based programming language like Factor stores executable code in an image file. When Factor starts up it loads the image and starts executing the code stored in it. I wanted to explore some ideas with images and dynamic code generation so wrote a simple example on how to generate assembly, store it in an image and later load... more →

Factor on Windows Mobile 5

Slava has been working on porting Factor to the ARM CPU for running on a gumstix. Windows Mobile 5 devices also use a chipset that uses the ARM architecture. Doug Coleman, another Factor contributor, has a Windows Mobile 5 device and was keen to get Factor running on it. Between us we'd been trying out the various options to compile... more →

Factor to Javascript Compiler Makeover

I've made some changes to the way the Factor to Javascript compiler REPL works. I used 'termlib' to make a terminal style interface for the REPL. Instead of entering Factor code, hitting submit, and waiting for the result, you can type in a listener style REPL, hit enter and get the result back. It works much better. History is available... more →

Factor Compiler Transforms and Shuffle Words

Factor has a couple of different ways of automatically generating code. One of these is 'parsing words'. These are words that get run at parse time and can generate code that then gets compiled. I used this approach in the 8080 emulator to parse a domain specific language into Factor code: INSTRUCTION: LD SP,HL ; opcode F9 cycles 06 more →

Concurrency via Generators in Javascript 1.7

Neil Mix, the author of Narrative Javascript, has a post about implementing concurrency in Javascript 1.7 using the new generators feature of the language. His example is here and the threading code behind it is just 4K. The example requires Firefox 2.0 for the new Javascript 1.7 features. more →

Lunar Rescue Emulator

The Space Invaders emulator I wrote is actually a generic 8080 emulator. Quite a few arcade games used similar hardware to the old Space Invaders machines. more →

Emulating other Intel 8080 Based Arcade Games

I've done some refactoring of the Intel 8080 emulator I wrote in Factor and split the games out into separate libraries. ROM's can now be stored anywhere with the path to the root of the ROM directory set in the 'rom-root' variable. Many of the 8080 based arcade games use similar hardware to Space Invaders. If they use a similar... more →

Space Invaders gets Sound

Following up on my previous post, I've added sound to my Space Invaders Emulator written in Factor. I used the .wav files obtained from the Space Invaders Didactic Emulator and also used the hardware information from that site to work out how the Space Invaders sound system worked. If you have OpenAL and ALUT installed you should be able to... more →

OpenAL library wrapper for Factor

I've written a wrapper for the OpenAL sound library for Factor. It's a thin alien wrapper around the C interface and was pretty easy to write given Factor's great C FFI support (called 'alien'). It has been tested under Windows and Linux and should be easy to get going for the Mac. You'll need to install OpenAL and ALUT. Binaries... more →

Article Management System

I usually have a collection of notes and howto's that I've gathered as I worked out how to do things and file them away. Sometimes they're not really relevant for blog postings or I prefer to be able to edit them over time to keep them up to date - which is not really useful for weblog postings without spamming... more →

Parser Combinators

Gilad Bracha has a post on parser combinators in Smalltalk. It's a good introduction to parser combinators and how to implement them in an OO language. Christian Plesner follows up with more details on writing and using parser combinators in Smalltalk. Christian mentions the left recursion problem for parsing things like lists. For example this grammar: <expr-list> -> <expr-list> ","... more →

JSON Web Services with Factor

There's a post on Matt Croydon's weblog about using Lua to process JSON Web Services. The resulting Lua code is very easy to read. Here's my attempt at the same code in Factor: REQUIRES: libs/http-client libs/json ; USING: kernel io http-client json hashtables prettyprint sequences math namespaces ; more →

ODBC Interface for Factor

I've written a simple wrapper around the ODBC API for Factor. I based it on some Forth code I wrote a few years ago. It has only been tested in Windows but it works quite well and I plan to do some more work on it as I need features. In the meantime it's in my repository: darcs get http://www.bluishcoder.co.nz/repos/factor more →

Erlang and Mobile Phones

Luke Gorrie has started a new weblog and he's posting about his experiences learning Squeak Smalltalk. In his first post to the weblog he mentions what he's been working on the past couple of years: more →

Implementing concatenative words with Pattern Matching

There's a dicussion on the concatenative mailing list about concatenative languages and macros. The discussion veered into pattern matching and Manfred Von Thun wrote about using pattern matching to implement common concatenative operations. I wrote previously about using pattern matching in Factor to do similar, calling the word 'shuffle'. For example, 2dup, could be implemented as: { ?a ?b }... more →

Basic Authentication added to Factor web server

I've added a simple basic authentication mechanism to the Factor web server (called 'httpd'). Basic Authentication is built into all browsers so it makes for a simple authentication method. It has one major downside and that is the password and username are sent from the browser to the client in clear text. You can work around this by using SSL... more →

Factor Pattern Matching Additions

I've made a couple of additions to the pattern matching library I wrote for Factor. The idea came from a suggestion from Slava in #concatenative. The main addition is a 'match-replace' word. This matches an object against a pattern and constructs a new object given a second pattern. The second pattern can use pattern matching variables from the first pattern... more →

Search and Replace with Parser Combinators

I've added some code to the Factor parser combinator library to allow search and replace using parser combinators. The idea was to be able to do similar things with parser combinators that regular expressions are commonly used for. I've also started adding some simple reusable parsers for numbers, strings, etc. The search word takes a string and a parser off... more →

Cross Domain JSON with fjsc

I've added support to fjsc for cross domain AJAX calls to web services that use the JSON format. Usually Ajax requests from a web page are limited to requesting resources on the server that the web page originated from. A way to work around this is to load cross domain Javascript by creating an HTML SCRIPT tag dynamically, setting the... more →

Continuations added to fjsc

I've added support for continuations to the Factor to Javascript compiler. The public interface is the same as the standard Factor continuation support. Namely the 'callcc0', 'callcc1', 'continue' and 'continue-with' words. This involved quite a few changes to the internals of the compiler. The Javascript generated code is now in continuation passing style (CPS). It makes the generated code harder... more →

Factor to Javascript compiler updates

I've done some minor updates to my compiler from a subset of Factor to Javascript. The updates are now running on the fjsc test page and available from my repository: darcs get http://www.bluishcoder.co.nz/repos/factor more →

Parser Combinator enhancements

While working on the Factor to Javascript compiler I struck some performance issues with how I was using Parser Combinators. The problem manifested when parsing word definitions. For example: : foo ( a b -- c d ) one two ; more →

Factor interface to Google Search

About a year ago I wrote some Factor code to use the Google SOAP API to run automated Google searches. I wanted to put together the results of a quick search so I fixed the code to work with the latest Factor release. The code is in my repository and will hopefully eventually make to the main Factor repository. You... more →

Compiling Factor to Javascript

A while back I wrote a toy Factor to Javascript compiler to use as an example in my Compilers and Interpreters post. I ended up using a different example in that post so didn't do any further work on it. Yuuki from #concatenative is writing a Factor tutorial and I thought it might be useful to put something online to... more →

Factor gets XML-RPC

Factor has an XML-RPC library thanks to Dan (littledan in #concatenative). Slava has a post demonstrating how to use it to talk to the paste.lisp.org pastebin. more →

Propeller Forth

Cliff Biffle announced on the Parallax Forums the release of Propeller Forth. This is an interactive Forth system for the Parallax Propeller Chip. The Propeller is a multi core chip. It has 8 32-bit chips processor on the one chip. Propeller Forth has multitasking words to take advantage of this parallelism. more →

Factor Parser Combinator example

I was asked on IRC how to use parser combinators to write a simple translator from s-expressions to Factor quotations. The translation was quite simple - here are some examples of how it was supposed to work: (set a 10) => [ "set" "a" 10 ] (set square (lambda (n) (* n n))) => [ "set" "square" [ "lambda" [... more →

Factor 0.86 released

Slava has released version 0.86 of Factor. In other Factor news, Doug Coleman has started a blog with a focus on Factor programming and tutorials. more →

Writing a Lisp Interpreter in Haskell

A neat article that appeared on reddit just recently: Writing a Lisp Interpreter in Haskell. It's interesting to compare the approach to my recent post on writing interpreters in Factor and my parser combinator article for the s-expression parser. Apart from the fact that Haskell is a typed language, the approaches are quite similar. No surprise there since I based... more →

Compilers and Interpreters in Factor

Writing compilers and interpreters in Factor is quite easy. By writing the grammar using parser combinators, and having those combinators produce an abstract syntax tree (AST), it's easy to write a simple compiler or interpreter for the tree. I've already covered writing simple parser combinators so I'll concentrate on processing the AST for a simple language in this post. A... more →

Narrative Javascript beta 1 released

Neil Mix has made Beta 1 of Narrative Javascript available. This release includes an official threading API with support for futures. I'll be revisiting my previous examples of using threading and futures with Narrative Javascript to move things over to this new API. more →

Flapjax

Flapjax is a very interesting looking client side browser framework. It's a superset of Javascript that provides Functional Reactive Programming to the client side browser. From the Flapjax website: more →

More on Jwacs

Bill Clementson has a post summarising the lispvam meeting discussing jwacs. A great transcript of the presentation is also available. more →

Lazy file reading in Factor

I've added a couple of new lazy list routines in Factor to do lazy stream input/output. These are lazy counterparts to the standard contents and lines words. The new words are 'lcontents' and 'llines'. The first returns a lazy list of all the characters in the file. The second returns a lazy list of all lines in the file. Both... more →

Factor code to upload to the S1 MP3 Player

Futher to my post on using Factor to program the S1 MP3 Player, I got some basic code working to upload Z80 code and execute it. It requires updates to the usb code in my Factor repository: darcs get http://www.bluishcoder.co.nz/repos/factor more →

Writing your own MP3 player firmware

The S1 MP3 Player (or 's1mp3' as it is commonly known as) is a generic type of MP3 that is used and branded by a number of manufacturers. It uses a chip that is firmware updatable, where the firmware is written in Z80 machine code. A number of people have written third party tools allowing writing and running their own... more →

Factor Lazy Lists Revisited

I originally wrote the Lazy Lists library in Factor to support the Parser Combinators library. It was one of my first libraries in Factor and was probably not very well written. Matthew Willis worked on it for the recent Factor releases to get it working with the removal of the standard list datatype and made it a lot better in... more →

Javascript with Advanced Continuation Support

Bill Clementson has an announcement for the next Vancouver Lisp Users Group meeting. This one is about a web framework called jwacs, Javascript with Advanced Continuation Support. It's an interesting library that seems to fit into a similar space to Narrative Javascript. It compiles a superset of Javascript, with support for continuations, into normal Javascript which is then run on... more →

Serializable Gadgets

As Slava has noted, I've managed to get the serialization code to the point where it serializes user interface gadgets. To demonstrate it I serialized an in-progress game of Space Invaders, uploaded the serialized file to my web server and someone else on IRC downloaded it, deserialized it, and continued where the game left off. Given the gadget on the... more →

Pattern Matching in Factor

For the concurrency library in Factor I've struggled to come up with good ways of writing the main loop of processes that handle messages. Erlang makes it so nice being able to create tuples and break them apart using pattern matching. I've gone from using Factor arrays and breaking them apart with 'first', etc to using generic functions. The latter... more →

Object Serialization with Factor

As Slava noted in his weblog, I've tidied up a previous serialization library to get it working with current Factor versions in the hopes of using it to get distributed concurrency working. The serialisation supports most Factor types and is extensible by adding methods to generic functions. You can even serialize quotations containing words, and so long as those words... more →

Cells style gadget updating in Factor

Factor has a Cells like mechanism for propogating changes in models to their GUI representation (called Gadgets). It's like a lightweight functional reactive programming system. Using the latest darcs Factor code, which includes a Calendar library, you can quite easily get a gadget displaying with a dynamically updated date. To have a gadget dynamically updated it must reference a 'model'... more →

JSON parser for Factor

I've implemented a simple JSON parser for Factor following RFC 4627. It will be available soon from the standard Factor repository and is also available from my darcs repository: darcs get http://www.bluishcoder.co.nz/repos/factor more →

Slipwave Javascript libraries

I came across slipwave today which has a number of interesting Javascript libraries. Of interest to me is js.lang.Recompiler which does a CPS transform of Javascript code, similar it seems to Narrative Javascript. On top of this is built a thread library including thread groups and semaphores. Other libraries include a Javascript interpreter written in Javascript. more →

Trapexit is back

Trapexit, one of the best Erlang resource websites is back in action. The forum on trapexit mirrors the Erlang mailing list and has a much better search mechanism it's a great resource and I missed it while Trapexit was down. Announcement of Trapexit coming back is here. more →

Javascript continuation based webserver

Tony Garnock-Jones has taken the server-side Javascript example I did and built a continuation based web server framework around it. His blog posting demonstrates the Seaside counter example in Javascript. To test it out, get it from Tony's darcs repository: darcs get http://www.lshift.net/~tonyg/javascript-server/ more →

Lightweight Erlang with Package Management

A post on the Erlang mailing points to a lightweight distribution of Erlang with package management facilities to enable installing extra functionality. The first install is a 1.4MB file which expands to 3MB. This is compares favourably to a full Erlang installation of 35MB (for the windows download). Functions are included to list, install, remove and upgrade packages. more →

Little Smalltalk and Javascript for Minix

I've been working on porting some small programs to Minix to get familiar with what's required for ports. From there I hope to get some bigger stuff working that I really want to use like Factor and Erlang. So far I have Little Smalltalk working (including the web based class browser and editor) and SpiderMonkey Javascript. Porting is a little... more →

Lightweight threads with Narrative Javascript

I've put together a very simple lightweight threads example with Narrative Javascript. The demo creates two threads: function t1() { var element = document.getElementById("one"); var count = 0; while(true) { sleep->(100); element.innerHTML=count++; concede->(); } } more →

HTML Template Languages

There's a discussion going on in the Erlang mailing list about HTML template engines. This is JSP-style definition of HTML pages with portions replaced dynamically with data from an application. I've leaned towards building HTML pages in code using Lisp style S-expressions for HTML, or Seaside style building of pages. This is also the approach I took in building the... more →

More on Ajax and server push

So far I've looked at two ways of doing server push. The first used a hidden IFRAME which had the SRC attribute set to a persistent connection on the server. The server would push Javascript code along this connection whenever it wanted the client to do something. This had the downside of the browser always displaying a 'loading' indicator as... more →

Real-time Wiki

From the Erlang mailing list comes a pointer to 'Real-time Wiki'. It's a Google Summer of Code project that allows using XMPP (ie. Jabber) from a browser based client. Values can be changed from the server and the change is broadcast to the clients and instantly updated. It seems that the application for this is a Wiki that updates automatically... more →

Unenterprisey Languages meeting

There's an 'Unenterprisey Languages meeting' at 4pm this Saturday (the 10th of June) in Wellington, New Zealand. It's being held in the L2 boardroom at Catalyst, Level 2, 150 Willis St. Speakers so far are: more →

Migrating Javascript Threads

A while ago in my old weblog I posted some Sisc Scheme code to demonstrate a thread migrating from one Sisc session to another. Since Rhino, the Java based Javascript implementation, has serializable continuations I decided to try porting it to Javascript. The code demonstrating it is in migrate.js. Loading this into a Rhino session provides a function called 'messageListener'... more →

Associative Arrays and Javascript

Andrew Dupont has a post about Associative Arrays in Javascript. He makes the good point that you shouldn't use the Array object for this functionality, instead use 'Object'. Unfortunately using 'Object' has its own set of pitfalls. Try the following code in your favourite Javascript implementation: var x = {} x["toString"] more →

Phobos available for download

Phobos appears to be available for download now. Phobos is the server side javascript system that Sun is making available. Robert Chinnici has a blog outlining features of Phobos and answering the question about why you'd want to use Javascript on the server. more →

Minix and Haskell

There's an interesting post on the Haskell group about Minix and the possibility of writing OS core components in Haskell for it. Minix is an open source operating system that's been around for quite some time. I first tried it out sometime in the early 90's after downloading over some very slow dialup connection connected to a BBS. From the... more →

E4X with Server Side Javascript

I've updated the Server Side Javascript distribution to include an example which uses E4X. E4X is described in Ecma-357 and adds a Native XML syntax to Javascript. The XML is converted to a Javascript object which can be used to query and manipulate the XML. The E4X example servlet generates the XHTML to be displayed using: var result = <html>... more →

More concurrency in Narrative Javascript

I've added to my lightweight threading example in Narrative Javascript to include support for sending and receiving messages between processes. The style of communication is based on the Erlang style of concurrency whereby processes communicate by sending messages. The threads2 example is here. This page has two processes running on it. They start when the page loads. Both processes block... more →

Javascript 1.7

It looks like Javascript 1.7 is getting some interesting new features. Brendan Eich did a presentation about what is being added and changed. One that looks useful for the concurrency things I'm playing with is destructuring assignment: var [a, b, c] = [ 'one', 'two', 'three' ]; more →

Partial Continuations and Narrative Javascript

I've been playing with Narrative Javascript and decided to have a go at porting the bshift and breset Scheme example to it. I'd previously had a go at this with Rhino. Trying some simple examples out it turns out that the continuations provided by Narrative Javascript are really partial continuations. Here's an example demonstrating this: var ex4cc ; more →

Narrative Javascript

Narrative Javascript extends the Javascript language to include a new operator. That operator allows writing procedural looking code that spans asynchronous operations. Very much like continuations enable writing web applications such that you don't need to break application flow to model the HTTP protocol, Narrative Javascript enables you to write your code in a sequential style and have it automatically... more →

Server side Javascript

An update to the code demonstrating E4X support is here. Ajaxian is reporting that Sun is releasing Phobos, a Javascript application server. This is a web server that runs Javascript for implementing the server side code. The source has not yet been released, according to Ajaxian, but will be. A while back I worked on doing server side Javascripting using... more →

Amazon S3

I've been playing around with Amazon S3 for a project I'm working on and I'm quite impressed with it. Amazon S3 provides unlimited storage for $0.15 per gigabyte storage and $0.20 per gigabyte of bandwidth. Once you sign up and get an account you can create 'buckets' which are named collections of stored objects. Each bucket acts as a billing... more →

Python to Javascript

Simon posted a comment on my post about the C# to Javascript compiler pointer out that there is a Python to Javascript system. So far I've come across converters to Javascript from the following languages: more →

Continuation based Web Servers

There's a lot of discussion going around at the moment about continuation based web servers. Some of the comments I've seen seem to be based on a misunderstanding of what exactly this type of server provides. Ian Griffiths has a post about why he thinks continuation based web fraemworks are a bad idea. Ian writes about 'Abandoned Sessions': more →

Script# - C# to Javascript compiler

Nikhil Kothari has a post on a C# to Javascript compiler. Similar in approach to Google's Web Toolkit it allows you to program your client side web code in C# and compile it to Javascript. From this: using System; using ScriptFX; using ScriptFX.UI; namespace HelloWorld { more →

Handling X-Forwarded-For in Yaws

I run a Yaws webserver behind a Pound proxy. This works really well but all the IP addresses logged by Yaws appear as the localhost (127.0.0.1). This is due to Yaws picking up the IP address of the proxy as it forwards the request. Pound sends the original IP address as a header in the HTTP request called X-Forwarded-For. This... more →

Icing - A Scheme continuation based web framework

Tony from LShift has announced an interesting looking project they've put together called Icing. They put SISCWeb, SSAX and SXPath together, along with their own code, to create a web development system in Scheme. It seems to cover generation of the user interface, accessing the database as well as using the continuation based SISCWeb framework for application flow. There is... more →

Linspire to use Haskell

According to the Haskell Weekly News, the OS team at Linspire are standardising on on Haskell as their preferred language for core OS development. Linspire is a Linux distribution. The announcement from the Linspire team is here. more →

Continuations with Mono

Tomi Valkeinen has implemented continuations on Mono, the open source implementation of the .NET VM. On top of that Tomi built light weight threads in C#, semaphores, sockets and channels. more →

Rhino in Spring

I wrote previously about an option to use Javascript on the server using Rhino. I came across 'Rhino in Spring' today which does this in a much more full featured manner. It is a continuation based system that integrates with Spring allowing you to use Javascript to write web applications and use continuation based features. From the looks of it... more →

Google Web Toolkit

This is pretty nifty. Google have released 'Google Web Toolkit'. It's a system for writing ajax applications in Java. The Java code is compiled into Javascript which then runs in the browser. From the Google site: more →

Dojo and Spidermonkey

I attended the sessions on Dojo at the Ajax Experience conference to learn a bit about it. Previously I'd considered Dojo to be a large, hard to understand library but I came away quite impressed with it after attending the seminars related to it. You can use the included package mechanism to make the base package fairly small and have... more →

Playing with HAppS

I downloaded HAppS, the Haskell Application Server, I mentioned previously to try it out. I already had GHC installed so I could build darcs but I needed a few additional packages to install HAppS. Most of these I obtained via apt-get but I had to manually install the following two: more →

Why the Scheme->Javascript JIT doesn't work on Firefox

After doing some digging I've found a bug in the Scheme-in-Javascript implementation that seems to be the reason the JIT doesn't work on Firefox. The system uses Javascript objects as associate arrays (hashtables), mapping symbols names to definitions. For example: TopEnv['eval'] = function(list) { return doEval(list.car); } more →

Lightweight threads in the browser

I've made some updates to the Scheme in Javascript library. You can run it at the jsscheme page. I've split out the example scheme source and made it loadable via Ajax. To do this I use jQuery, a very nice Javascript library. I added a Scheme wrapper around the Ajax GET call so you can do code like this: (ajax-get... more →

Scheme Implementation in Javascript

A post on Lambda the Ultimate recently was about an Oberon interpreter written in Javascript, allowing Oberon to be embedded in the browser. This reminded me of an near-R5RS compatible Scheme written in Javascript called jsScheme. It's a very nice implementation to play with but is IE 6 only. I've done some hacking at it and made it compatible with... more →

Port Seaside to VAST?

Posted on the Seaside mailing list is a request for people to port Seaside, the Smalltalk continuation based web system, to VAST - a Smalltalk system. The offer includes the following incentive: more →

Source for Unify Available

The source for the system presented in the paper 'A Language Based Approach to Unifying Events and Threads' is now available. Download information is available at the Unify home page. more →

Space Invaders Emulator in Haskell

I been tinkering with Haskell lately to get familiar with a purely functional programming language. As a project to work on I'm trying to port the Space Invaders emulator I wrote for Factor to Haskell. I'm pretty much a complete newbie to Haskell and have no idea on the best ways to implement this type of thing. I'm starting simple,... more →

Javascript Partial Continuations

I've been playing around with Rhino, a Javascript interpreter written in Java, using it as a server side scripting language. Rhino supports continuations so I thought I'd try and port the bshift and breset implementation I ported to Factor to Javascript. My initial attempt is in partial-continuations.js.This can be loaded into the Rhino interpreter using: load("partial-continuations.js") more →

Building wxFruit and Yampa with GHC 6.4.x

wxFruit is a Haskell GUI library based on Functional Reactive Programming concepts. It uses wxWindows as its underlying GUI framework. For FRP it uses the Haskell FRP framework Yampa. Both libraries are relatively old and seem to have suffered bitrot as I couldn't get them to compile using a recent GHC build (GHC 6.4.x). A bit of searching came across... more →

Haskell Gameboy Emulator

OmegaGB is a Nintendo Gameboy Emulator written in Haskell. The author has a devlog where they are posting information about the implementation along with screen shots and source code. more →

jhc - Optimizing Haskell Compiler

jhc looks interesting. It's an optimizing Haskell compiler "...that aims to produce very efficient code as well as explore novel compilation techniques in an attempt to make them practical." Two things from the site that interested me were: more →

SISCweb v0.33 announced

Alessandro Colomba has announced the release of version 0.33 of SISCweb. SISCweb is a continuation based web server written in SISC, a Scheme implementation that runs on the JVM. New features mentioned in the release announcement include: more →

Pushing events from the server to the browser

I've written in the past about the ways of pushing events from the server to the web browser. Recently a this model of usage has had a term defined for it called 'Comet'. My plan was to have a library that modelled a web page as an asynchronous Erlang process. Other Erlang processes can send it messages using the standard... more →

Factor and The Computer Language Shootout

I implemented one of the Computer Language Shootout benchmarks in Factor to see how it would compare. I wanted to get a gauge of the comparative performance of compiled Factor as well as seeing how the Factor implementations of the algorithms looked. I started with the recursion benchmark. A darcs repository containing the Factor code and the C code for... more →

Generators in Common Lisp

Matthew Swank posted an example of generators using Common Lisp in comp.lang.lisp. His implementation contains a monadic implementation of continuations and call/cc which is quite nice, and the resulting thread has a dicussion on the some implementation variations. A simple example of using the call/cc implementation from later in the thread: ;; Scheme version (call/cc (lambda (k) (k 42))) more →

Factor Partial Continuation Updates and Iterators

I've made some changes to the parser combinator library I wrote for Factor. The changes were to make the usage of the library to be more consistent with good Factor style. The first change was to ensure that items on the stack are accessable in an intuitive manner from within the quotations passed to breset and bshift. When writing combinators... more →

Augment

If you think that we've made great progress in computer systems over the last ten years, take a look at Brad Neuberg's screencast of the Augment system developed in the 60's. Augment is the first system developed with groupware, email, outlining and interaction with the computer. Many of the 'new' features we see today are evident in the Augment system.... more →

Partial Continuations and Factor

I've written some partial continuation support and put it in the Factor contrib directory. It implements bshift and breset as outlined by Oleg's post on comp.lang.scheme. It's in contrib/partial-continuations.factor and can be pulled from my repository until it makes it to the official Factor repository: darcs pull http://www.bluishcoder.co.nz/repos/factor more →

Io Garbage Collector

Steve Dekorte has made the garbage collector used in Io a seperate library and released as open source. It's available at the libgarbagecollector page. more →

Erlang SMP support

Snapshots of the upcoming Erlang release with SMP support are available from the Erlang site. As mentioned by this post on the Erlang mailing list, any of the P11B snapshots have SMP support and should be built with the following flags to enable it: ./configure --enable-smp-support --disable-lock-checking more →

Alan Kay on Lisp

Alan Kay, inventor of Smalltalk, apparently gave some interesting talks at the University of Utah recently. Bill Clementson has a post about the talks and some of the comments Alan has made about Lisp in the past. more →

Jaws Erlang Web Framework

Joe Armstrong posted on the Erlang mailing list about Jaws, a web framework he is developing in Erlang. Jaws has a template language for the Yaws web server that allows mixing HTML and Erlang similar to PHP, JSP, etc. Multiple pages can be specified in a single file and it provides Ajax functionality. It looks very interesting, hopefully a release... more →

Javascript and Generators

Could Javascript be getting generators, iterators and list comprehensions? This post from Brendan Eich is a status update about the future of Javascript that mentions the possibility (From Ajaxian). js> function count(n) { for (var i = 0; i < n; i++) yield i; } js> g = count(10) [object Generator] js> g.next() 0 js> g.next() 1 js> two_to_nine =... more →

Concurrency

Bill Clementson has been posting about concurrency in programming languages and linked to me about my use of Erlang. I've been using Erlang for a personal project for the last few months and I've found it very easy to use. The ability to spawn processes without the need to worry about any practical limits is quite interesting. I've found that... more →

Observers, Erlang and Server Push

As I've mentioned previously, I'm working on a framework for pushing events from an Erlang based web server to browser based clients using AJAX. My goal being to make it look like normal Erlang message sends to 'processes' running on the browser. I have a server process that needs to broadcast events to interested parties whenever something of interest happens.... more →

Uptick resurrected

Joel Reymont is resurrecting his Uptick project. Uptick is intended to be a realtime trading platform. It looks like he has decided on Erlang/OTP for the platform to build it on. There is more information on the Uptick mailing list. more →

GECODE constraint development environment

GECODE version 1.0 has been announced on the Alice mailing list. GECODE is an open source library for developing constraint-based systems and applications. It is used in the Alice programming language implementation to provide the constraint facilities of that language. Although the source of Alice has been available for awhile, the source for GECODE had not been released. Now it... more →

Backbase LiveGrid and DataGrid

Backbase have released version 3.1.1 of their rich internet application framework. It contains a large number of 'web 2.0' goodies. The two big ones are live grid and data grid components. The live grid is a paging component that lets the user just use a scroll bar to lazily load data frmo the server. Only the items displayed in the... more →

Haskell and Erlang

Joel Reymont has another post comparing Haskell development against Erlang. He has recently rewritten the work he did in Haskell to develop poker bots for testing a poker server into Erlang: more →

Real World Haskell Part 2

I mentioned previously that Joel Reymont is using Haskell these days for some of his 'real world' programming systems. I hoped at the time that he would outline some of his stuff on his weblog with comparisons to Erlang. Since then he has put up a Haskell vs Erlang post where he describes some of the things he's come across... more →

Factor help system

Slava has been busy with Factor lately. Not only has he done a lot more on the AMD 64 backend, he's writing a help system that runs within Factor. more →

Porting DUIM to Common Lisp

DUIM is the Dylan User Interface Manager, the GUI library used in the Functional Developer Dylan system. Duncan Rose is porting it to Common Lisp. DUIM is a nice easy to understand user interface framework. I used it quite a bit to develop a number of Dylan programs. Many of my creatures programs and other things for example. It fills... more →

Factor website changes

Slava Pestov has moved the main Factor website to a new machine and is running it on the Factor web server. It's also running the Factor code browser. I've retired the browser I was previously running on factor.modalwebserver.co.nz as a result. Slava is using Linode to host the site. Linode provides 'User Mode Linux' machines within which you can install... more →

64bit Factor

Slava has a post about the AMD64 backend he is working on for Factor. There has been quite a bit of interesting progress with Factor recently, including some nice contributions. Someone has even written an X11 window manager in Factor. more →

Rewriting Reddit

Aaron Swartz writes about the rewrite of reddit in Python. Apparently the Python framework used, web.py, was written by Aaron. What I find most interesting is how quickly reddit was developed - and redeveloped. Only one weekend for the rewrite is pretty impressive. One reason for the fast implementation is because it's the second time they've written it and can... more →

Code replacement in Erlang

From DrXyzzy, a good article on how code replacement is done in Erlang. Code replacing allows replacing code in a running system with new versions, without having to bring that system down. more →

Solution Watch reviews DabbleDB

Solution Watch has a review of DabbleDB. It goes into good detail, showing an example 'todo' application being built. The review is very positive. DabbleDB is written using Seaside, a continuation based web framework in Smalltalk. more →

reddit rewritten in...

reddit, the popular web application written in Common Lisp, will now have to be known as the web application formally written in Common Lisp. It has been rewritten in Python. more →

Obfuscated Erlang

The results of an Obfuscated Erlang competition have been made available. From the announcement on the Erlang mailing list: more →

Trap Exit

Trap Exit is a great Erlang resource that I came across recently. It mirrors the Erlang mailing list as a forum, and has a number of great HOWTO's on using Erlang. more →