Hi, colleagues!

Last autumn I've started a small web-site with collection of programming problems for beginners. To solve the tasks here users are to submit answers calculated after processing some randomized data. I.e. it is resembling ProjectEuler which I admire greatly :)

http://codeabbey.com/ - that is how it looks like.

Now I want to add a new functionality - mini-challenges to write the smallest code possible - i.e. there would be some tasks for which the length of solution is assessed and ranked.

However, while all other tasks could be solved in any possible language (and users even are not required to post their sources, though they usually do this) since it is not clever to compare the length of solutions in different languages.

Instead I want to choose some minimalistic language, probably esoteric - and build the interpreter into my site, so the solution is processed to check it validity. All users will use only such language for such "minification" tasks and it would be easy to compare solutions.

The only problem is that I'm not sure what language would be suitable. Brainf--c and Whitespace are too esoteric - they have different programming model at all. Befunge seems closer, but it is two dimensional :D

I had an idea to use my own "language" - for example this:

http://rodiongork.github.io/Prayer/ - and here is its code at github

however I'm not sure it is quite suitable - initially it was created for quest game engine (which I failed to complete).

I would prefer some better known language, especially with a number of usable tools...

So here am I looking for help / suggestions. You see, I do not know much of esoteric languages and it seems now I really need a good advice. So thank you in advance! :)

Recommended Answers

All 3 Replies

I would suggest a strongly recursive language such as prolog, lisp, snobol, APL, etc. :-) Yeah, we are getting into the prehistoric era of programming, but that doesn't say some of those languages aren't appropriate for this purpose!

These days, given the penchant for web-based programming, javascript or some of the newer languages that compile to JS may be appropriate as well.

Thanks for your answer!

To be honest I see no reason (and no way) to use such languages :)

As I've told I'm thinking of building the interpreter for chosen language into my site. I can easily create in PHP an interpreter of brainf--k, but not for Prolog or Javascript. APL is minimalistic enough, but without a typewriter the half of its symbols could not be reproduced :D

Though something like APL would be a good idea, I'll research more!

I think you'll find a purely functional sub-set of Scheme sufficiently simple for you needs. It is famously easy to implement in a short program, and requires relatively few resources (mainly, some form of garbage collection or reference counting - the latter of which PHP already supports IIRC). Several online books, including Lisp In Small Pieces and Structure and Interpretation of Computer Programs, discuss implementing a Scheme interpreter in detail.

Peter Michaux's Scheme from Scratch blog series has a step-by-step explanation of how to do it (in C, but it would be a small matter to adapt it to PHP). I would recommend the article to all programmers, but especially to someone looking to do what you are doing - even if you don't end up choosing Scheme as your language.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.