Quantcast
Channel: Exploring Beautiful Languages
Browsing all 25 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Using traits to reuse code in Pharo

While working on a small Tetris-like clone in Pharo, I found an opportunity to reuse some code.It's common for Tetris implementations to show a small preview of the tetrimino that comes next. Here's...

View Article



A couple of quick notes on Mercury #1

I'm trying to learn about Mercury programming language. Here's a quick list of things I learned recently about it.Getting a Windows version of the Mercury compilerI was able to get a version of the...

View Article

Determinism categories in Mercury

When you define a predicate in Mercury, you have to specify if it can fail or succeed more than once. This is called a determinism category.The category is specified as part of a predicate (or...

View Article

Image may be NSFW.
Clik here to view.

Some things I learned while creating a small program in Mercury

Some time ago I started creating a program using the Mercury programming language to create images using the Escape Time algorithm. The goal was to learn about the language by solving a small...

View Article

Solving a small primary school problem with Prolog

A couple of days ago my small son came home with math homework from school. The problem: add parenthesis to the following arithmetic expression so it makes sense.14*3-8/2=17When I saw that, I thought...

View Article


A simple language with indentation based blocks (part 0)

One of the first things I noticed when reading about Python, is the use of indentation for defining code blocks. For example:def foo(x): while x <20: if x >10: print"argument is greater than...

View Article

A simple language with indentation based blocks. Part 1: Parsing combinators

In this post, I'm going to start with the implementation of the parser using the F# programming language. There are several tools for creating parsers for example...

View Article

A simple language with indentation based blocks. Part 2: Expressions

The focus of the second part will be expression parsing. The desired grammar for the expression small language experiment is the following (here in pseudo BNF):NESTED_EXPRESSION ='(' EXPRESSION ')'...

View Article


A simple language with indentation based blocks. Part 3: Blocks

In this post we're going to add support for statements containing blocks which is the main goal of these series of posts.Identifying blocks by using indentationThe technique we're going to use to...

View Article


A simple language with indentation based blocks. Part 4: Improving error...

Going back to our first post, we defined the type of a parser function as :ReaderState -> (('a * ReaderState) option )Which means that a parser is a function from a reader state to an...

View Article

Image may be NSFW.
Clik here to view.

A small Tetris-like clone using J and ncurses. Part 1

For me, the J programming language it's a very intriguing. It is full of ideas and concepts that I'm not familiar with. Getting to know a programming language it's not only about learning the syntax....

View Article

A small Tetris-like clone using J and ncurses. Part 2

This is part two of our Tetris-like clone in J series. In this part we're going to see how the ncurses interface was created.Creating the ncurses UITo create the user interface we used the ncurses UI...

View Article

Image may be NSFW.
Clik here to view.

Using Racklog for parsing

This post shows a small experiment of creating parsing predicates using the Racket's Racklog package . This package enables the use of logic programming features inside Racket. Logic programming...

View Article


A quick note about programming in Prolog

Prolog predicates work in different ways depending on how you use them. A simple example is the append predicate. One may say that append is used to get the result of appending two lists. For...

View Article

Image may be NSFW.
Clik here to view.

First programming language: GW-BASIC

Like many developers my age, the first programming language I ever used was BASIC. Specifically, GW-BASIC in a nice Epson "Abacus" XT machine with a green-on-black monitor back in primary school.For...

View Article


Image may be NSFW.
Clik here to view.

A small experiment with fragment shaders

I wanted to work on an experiment that allowed me to learn a little bit about modern graphics programming with OpenGL (with shaders that is). A nice choice is the 'hello world; of graphics...

View Article

Reading APL #1: Roman numerals to decimal

As part of a new recurring series I’m going to take a small APL function or program and try to break it down in to its parts. I hope this is going to help me get a better understanding of the...

View Article


A small programming exercise in APL #1

This post shows a possible solution written in APL for the following programming problem: Given an array, determine if a value 'number' is found in every consecutive segment of 'size' elements. For...

View Article

A small programming exercise in APL #2: Combinations

In this post I'm going to continue my APL exploration by working in a possible solution for the problem of generating all the combinations of 'n' elements of an array.Generating the 'n' combinations of...

View Article

Image may be NSFW.
Clik here to view.

Exploring a Webpack stats file with Prolog

A couple of days ago I was reading about the Webpack statistics file created using the following command line options:npx webpack --profile --jsonThis file contains a lot of information collected by...

View Article
Browsing all 25 articles
Browse latest View live




Latest Images