🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

On creating the universe

Published April 15, 2007
Advertisement
I've discovered an interesting truth about creating a programming language: you won't have enough motivation to do it right, unless you already have a program you want to write in that language. It doesn't matter how stupid the program is; if you don't have a problem to solve, the language won't go anywhere.


My first program will be a Sudoku solver, for a few reasons:
  • They're simple and straightforward, but leave room for interesting optimizations and designs

  • The rules can be expressed in a variety of ways which will force me to think about how domain knowledge is represented in the language

  • I've been wanting to write one for the hell of it for a while anyways

  • Someone just gave me a large book of Sudoku puzzles, and I can't be bothered to finish them by hand; just writing a program to finish them seems a bit like cheating, so I'll create a programming language to write a program to solve them. That's about fair I think.



(Yes, fans and enthusiasts, this means Epoch is officially back in action - please try to contain your excitement. I don't want to get any unbridled joy on my shirt.)
0 likes 5 comments

Comments

Daerax
I was looking at the maths of sudoku recently. Alot of it is based on permutation groups, similar to, but much more advanced than the stuff im playing with in haskell and nemerle.

Hope to hear more on this. But these journals are a dead place. Few interesting discussions ever arise so I am skeptical.
April 15, 2007 10:17 AM
nolongerhere
Yay its finally back! But yea ive came to realize its hard to code a language without having something to program to fit the goals of the language around. I just recently realized that also applies to game engines but its all a learning experience!

Cant wait to see how it looks and dont be afraid to do things differently with this language just because wide used languages dont, do what WORKS!
April 15, 2007 11:48 AM
jollyjeffers
Good choice of puzzle...

I was sitting on the train on the way to work last year and tried one of those Sudoko puzzles. Got bored and instead worked out a (probably inefficient) algorithm to solve all sudoko's and decided I never needed to do them by hand again. Kudos for going one step further and writing the language to solve the problem a well [lol]

Jack
April 15, 2007 12:32 PM
ApochPiQ
I've been scribbling around with the syntax and managed to write out the complete rules for verifying a board; assuming the language only provides arbitrary matrix and array types, the whole thing is about 14 lines of code. There's still a bit of verbosity and a lot of rough edges, but that's quite a bit cleaner than I could manage to do in, say, C++. (Now, I'm sort of cheating a bit by assuming that the language and/or library has built-in map and reduce functions, but still.)

I expect that the syntax is going to go through a lot of refinement before it's ready for even early public display; and even then, I expect that with general input (i.e. feedback from people smarter than me) it will be refined quite a bit more. At the moment it's a sort of Frankenstein conglomeration of LISP and Ocaml [grin]

At the moment it looks like the type system is going to be the most difficult part to sort out, syntax-wise. I want a robust statically typed system, but with inference and rich conversion semantics - i.e. variables are always statically and strongly typed, but conversion operators are plentiful, so the language can look dynamic and/or weakly typed without actually sacrificing the advantages of strong, static typing. Of course I'm also wanting to avoid manifest typing as much as possible, and these concerns are naturally tricky to balance.

Anyways, more updates as things continue to progress (which will probably be slow, considering that this is a pretty low-priority project). The next big step is to decide on an algorithm for actually finding the solution. I'm thinking of just doing a brute-force version first and then working on a parser and interpreter so I can get things running; we'll see how it goes from there.
April 15, 2007 02:41 PM
bladerunner627
Ah, I wrote a Sudoku solver a month or so ago. It works on most puzzles but not all.

Feel free to look at it for ideas, or w/e http://www.gamedev.net/community/forums/mod/journal/journal.asp?jn=402684&reply_id=2932105
April 15, 2007 05:54 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement