Recently I’ve been thinking more about a toy language I have created called rose. It’s largely an exercise to teach myself about some of the difficulties of language design, giving me a greater understanding and apreciation of the languages I work in. Some of the guiding features of rose are immutable-by-default fields and as few [...]
If you ever read any of my code you’re probably likely to come across something like this, and equally likely to find it a little bizarre. for (int i = 0; i < length; i += 1) { // Some code } I have issues with the standard increment and decrement operators in C style [...]
I often find myself creating elaborate spreadsheets to help with things. Usually it amounts to cells with huge nested if statements which, if you’ve never used an Excel style language, looks like this: =IF(D3″”,IF(A3=0, IF(D3=0, 0, 1), “-”),”") And that’s a simple example. The basic syntax is IF(Pred, Then, Else) and nesting them all on [...]
As I move more and more towards a functional style of programming I often find myself using referentially transparent functions in amongst the rest of my C# code. A referentially transparent function is basically one that guarantees that it has no side-effects (modifies anything outside of the function) such that every time you call it [...]
I’ve had a few issues with moving from VS2008 beta 2 to the release version, so have not really been able to progress with the code for IronTuring. This has lead me to step back and think a little harder about the syntax I am using in terms of implementation (I know design and implementation [...]
I've been wanting to look into compilers (lexer and parser) for a while now, and recently decided to scratch my itch and design and write the compiler for a toy language I've called IronTuring. The language defines a simple Turing machine (a variation of a Finite State Automaton) which can then be compiled either into [...]
Combining my desire to learn more about parsing and the need for an ability to check various truth tables I have made a program that will take an expression and output a truth table for it. http://www.atomice.plus.com/TruthTables.zip It was written in Python, so you’ll need to download the runtime. You can either run it from [...]
C# has a lot of syntactic sugar (and from what I understand Visual Basic even more so). However, often this syntactic sugar hides more than is at first obvious. Take, for example, the “using” statement. This statement basically means “Create this variable and then, when you exit the following code block, call this variables Dispose [...]
I had planned today to have a hard days slog watching the remainder of Firefly. Unfortunately, however, I got a little sidetracked. My girlfriend linked me to a little problem one of her friends had been having. It involved finding an algorithm using stacks to create a random permutation of numbers. I couldn't find an [...]