views:

202

answers:

10

I've created an experimental toy programming language with a (now) working interpreter. It is turing-complete and has a pretty low-level instruction set.

Even if everything takes four to six times more code and time than in PHP, Python or Ruby I still love programming all kinds of things in it.

So I got the "basic" things that are written in many languages working:

  • Hello World
  • Input -> Output
  • Countdowns (not as easy as you think as there are no loops)
  • Factorials
  • Array emulation
  • 99 Bottles of Beer (simple, wrong inflection)
  • 99 Bottles of Beer (canonical)
  • Collatz conjecture

  • Quine (that was a fun one!)

  • Brainf*ck interpreter (To proof turing-completeness, made me happy)

So I implemented all of the above examples because:

  • They all used many different aspects of the language
  • They are pretty interesting
  • They don't take hours to write

Now my problem is: I've run out of ideas! I don't find any more examples of what problems I could solve using my language.

  • Do you have any programming problems which fit into some of the criteria above for me to work out?
A: 

Rather than more things to do in that toy language, I'd think hard about implementing a language that's somewhat more complete and useful. In particular, spend some time thinking about the things you dislike about other languages, and see if you can't improve them.

Jerry Coffin
+2  A: 

try implementing various types sorts and searches, using arrays and then pointers.

Sorting Algorithm
Search Algorithm

KM
doing this was fun back in high school, well kind of ;-o
KM
+2  A: 

Something recursive perhaps?

I've got two toy languages of my own. I've done some of what you described. Another thing I did was try to print out the Fibonacci Sequence. One more thing you can do is write a program that checks to see if a number is prime.

Do you have a link to your language? I'd like to check it out!

Vivin Paliath
I haven't created any web-presence for it yet, I'm planning to do so however. I'll try to notice you if I do :)
I can't tell you my name.
A: 

This could be a good application of the items you find at http://codekata.pragprog.com/2007/01/code_kata_backg.html#more

John Fisher
A: 

After you finish with writing a bunch of short applications it might be interesting to write a simple server. A lot of topics come up with servers that would help you identify if your language can address things like UDP/TCP, threading, queues, security, etc.

Adam
I would not advice this for a toy language. It's very domain specific and it doesn't help you add language features.
Pindatjuh
@pindatjuh: I respectfully disagree. I actually think there would be a large amount of features that could be created in the process of creating a toy server (note - not intended for any actual full blown production servers). Just off the top of my head the developer could add support for i/o, threading, data structures, etc. It all just depends on how far down this path he/she wants to go. I do agree that it might be a little much, but it would help him/her learn all the issues that come up with all that low level stuff.
Adam
A: 

Check out the RubyQuiz site. Plenty of silly little things you could do to test out your language.

bergyman
A: 

You could add support for arbitrary precision arithmetic by either writing it as a module for your language in your language or as a first class language construct.

gradbot
+3  A: 

Implement a compiler (to any language you know) for your language, in the language itself.

Jakob
Though requires a lot of understanding and if the language is not easily compilable, then it fails "They don't take hours to write".
Pindatjuh
They __do__ take hours to write, unless the languages are very simple.
Callum Rogers
Oh, I actually missed that part of the posters requirements. Lets hope it's a really simple language then (or that the poster's up for a bigger challenge) :)
Jakob
I would really love writing a compiler in it that translates code in my language to assembler - would be pretty hard, though as my language has built-in dynamic typing and string support.
I can't tell you my name.
Well, assembler is kind of overkill. Translate it into something that's not so far from your own language to begin with (which means something with dynamic typing and string support then). And even if you wanted to go low-level, C (or rather C--) would be a lot more portable than assembler. But that can wait until your language is the next Ruby I suppose :)
Jakob
+3  A: 

Try things from Project Euler - these puzzles are always good for testing out new languages.

Callum Rogers
+1  A: 

You could consider implementing the tests for the "Shootout".

Pete