Can you help me think of problems for my programming language? [closed]
Asked Answered
C

12

8

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?
Crambo answered 8/4, 2010 at 17:14 Comment(2)
You could get some more responses if you revise your title to something better descriptive of what you are asking. Perhaps something like "Can you help me think of problems for my programming language?"Dorthadorthea
"Conjatz conjecture", don't you mean "Collatz conjecture", en.wikipedia.org/wiki/Collatz_conjecture ?Tangential
M
4

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

Misrule answered 8/4, 2010 at 17:14 Comment(0)
P
3

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

Prosit answered 8/4, 2010 at 17:14 Comment(5)
Though requires a lot of understanding and if the language is not easily compilable, then it fails "They don't take hours to write".Tangential
They do take hours to write, unless the languages are very simple.Misrule
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) :)Prosit
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.Fullscale
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 :)Prosit
I
2

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

Sorting Algorithm
Search Algorithm

Ioyal answered 8/4, 2010 at 17:20 Comment(1)
doing this was fun back in high school, well kind of ;-oIoyal
G
2

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!

Gordongordy answered 8/4, 2010 at 17:21 Comment(1)
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 :)Fullscale
A
1

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

Anomalistic answered 8/4, 2010 at 17:14 Comment(0)
S
1

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.

Sardonic answered 8/4, 2010 at 17:20 Comment(0)
A
0

How about canonical data structures and algorithms? Or semi-canonical? For intance, I always wanted to implement associative array based on radix trie. That looks fun.

Alpenstock answered 8/4, 2010 at 17:14 Comment(0)
S
0

Try to implement something real. For example web based mail client. Do just abstract task is boaring.

Stopple answered 8/4, 2010 at 17:14 Comment(0)
F
0

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.

Fishbowl answered 8/4, 2010 at 17:14 Comment(0)
S
0

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

Stearin answered 8/4, 2010 at 17:14 Comment(0)
C
0

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.

Canaster answered 8/4, 2010 at 17:14 Comment(2)
I would not advice this for a toy language. It's very domain specific and it doesn't help you add language features.Tangential
@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.Canaster
U
0

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

Underwent answered 8/4, 2010 at 17:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.