Compiling Lua with Visual Studio 2010
Lua?Lua is a dynamic, object-oriented, interpreted language. Most programmers are aware of it as the scripting language used in the game World of Warcraft, as well as a number of other games. However, Lua has been getting a lot of good press lately for a number of reasons. Last...
Categories: News
Mixins Simplify Composition in Scala
Scala has a nifty feature called “traits.” A trait is a means of encapsulating methodsand fields that behaves in some ways like an interface, and in other ways likean abstract class. Like an interface orabstract class, a trait can declare methods and fields that must later bedefined in some...
Categories: News
F# vs. Scala, My Take at Year Two
I spent a lot of time over the last couple of years learning F#. Over the last six months, I’ve spent most of my time learning and working in Scala. During part of both those times, I was working on the same set of code, ported to both languages. So, though this topic has been covered before,...
Categories: News
New Year's Resolution: More Blogging
I hope to get back to this blog soon, in fact, it's one of my New Year's resolutions!In the meantime, here's a thought.It's really easy to write external DSLs using s-expression languages. A decent parser can be hand written in a few hours, and the eval process is well understood and documented....
Categories: News
F# Enters the Tiobe Top 20!
For the first time, F# has entered the TIOBE Top 20!The TIOBE index rates programming language popularity based on a number of criteria. This is certainly a feather in the cap of F#, and all those who have worked to promote the language over the last year deserve congratulations. But now is not...
Categories: News
F# User-Defined Numeric Literals
Today’s blog is about something most F# programmers have perhaps never encountered: user-defined numeric literals. I won’t go into too much detail; the available documentation does a much better job than I could:From the F# specification.Reference manual page.F# Power Pack. (Source code file q.fs...
Categories: News
More on Significant Whitespace (in F#, Python, Lua, and Ruby)
Since I want to add it to my coding “Room of Requirement,” I decided to keep working on the indentation processor a bit and make it more general. So here is a version that uses an interface to do dependency injection. (And as always, the code and information here are presented "as-is" and...
Categories: News
Significant Whitespace, DSLs, and You (in F#)
Today’s post shows some simple code for teasing out the structure of a text file based on its indentation. A trend in computer science is for computer languages to rely more on significant whitespace. Of course, that is true of F#, but Python has introduced the concept to an even wider audience...
Categories: News
Oops! Correction to Post Dated August 8, 2010
Oops! I found a bug in the code listed in the blog post titled: Segment Tree in F#. The bug is in the "findCollect" function, and it’s really rather glaringly obvious. It looks like a “my-brain-was-out-to-lunch” error as I was transcribing the algorithm either from my head or from pseudo-code....
Categories: News
My Dinner with Haskell
It’s impossible to go very far into either the F# world or the world of domain-specific languages (DSLs) without encountering Haskell. It seems like all the F# gurus are also Haskell gurus, or at least Haskell aficionados, and a lot of people use Haskell for prototyping new languages (including...
Categories: News
Project Euler #1 - One Problem, Three Solutions, Seven Languages
I haven’t posted here in a long time, and I apologize for that. No particular reason, but all good: programming in F#, learning lots of new programming stuff, enjoying the fall and winter holiday season (including hand-making some Christmas gifts), etc.As I mentioned, one of the things I’ve been...
Categories: News
If Programming Languages Were Television Shows
I’m working on a more substantial post that compares several programming languages on a single problem. In the meantime, I give you something frivolous; my take on…If Programming Languages Were Television ShowsF# – Mythbusters. We don't just explain the functional programming myths, we put them...
Categories: News
F# Computation Expressions: Basic Data Retrieval Mechanics
One of the uses often mentioned for F# computation expressions is that of simplifying the syntax of database retrieval. To investigate how the mechanics of this could work, I decided to implement a simple relational retrieval system. I tried to pare it down to the utmost basics, and I’m happy...
Categories: News
More Novice F# Computation Expression Bind/Return Mechanics
Today’s post is more F# “beginner” stuff I’m doing to help myself learn to think about workflows (or computation expressions as they are also called). As I’ve said before, I’ve gotten to the stage where I can usually puzzle out how to make a workflow do what I need it to do. However, my goal is...
Categories: News
F# Computation Expressions, Yield/For Mechanics
Today’s episode of the ongoing computation expression saga features Yield/YieldFrom and For. One encounters fewer examples of these than of Bind/Return, though in most respects their operation is every bit as fundamental.The code accompanying this post shows the use of these computation...
Categories: News
F# Computation Expression Bind/Return Mechanics Continued.
Isn’t it always the way? Almost as soon as I posted the previous entry, I came up with an example I like better. Rather than replace that example, I’ll just post the new one here. This one adds overloads to Bind, which show how both multiple types of let! bindings as well as do! bindings can...
Categories: News
F# Computation Expressions, a Simple Bind/Return Mnemonic
I’ve gotten to the point where I can usually puzzle out what I need in a computation expression while I’m sitting at the computer. However, I can still have some trouble visualizing the process when I’m thinking “offline” (e.g. while in line at the grocery store, cleaning the rabbit’s litter pan...
Categories: News
F# Workflow for Building Immutable Trees from Delimited Strings
Here is an update on an earlier post: Computation Expressions with .NET Data Types. In that case, I showed how to use computation expressions to build a tree from a character-delimited string. However, there were two things about it I wanted to correct. First, my understanding of idiomatic F#...
Categories: News
F# Async Computation Expressions: A Tiny Model System
Continuing my quest to learn computation expressions, I decided to explore from scratch the implementation of basic asynchronous behavior. This post is the result. It’s not too fancy, and lacks basic safety, resource management, etc., SO DON’T SIMPLY COPY AND USE IT IN REAL LIFE, but it gets...
Categories: News
Basic F# Computation Expressions Using Yield and Combine
I decided to learn a little bit about computation expressions beyond the basic Bind/Return operations. So I made a goal of learning something about the Yield/Combine operations. To demonstrate these operations, I decided to leave behind the world of tomato pricing and return to the simple...
Categories: News
