A fun little thing

I wrote a toy. It's fun to play with, so I figured I'd share.
The idea is to define a bunch of rules, consisting of a regular expression and a composition of parts of the string matched. The language then tries to apply each rule to the input until no regexp matches it.

Source:
http://codepad.org/KrjVPOog
http://codepad.org/dzQKjsgA
Yeah. That's Haskell. Not too well written either.. (I'd be glad to hear comments)

Not to overcrowd this post, a tutorial/specification:
http://pastebin.com/A98krS5r
I've had (and fixed) some bugs in the language. Silly ones mostly. I can't promise there aren't more. If you find any, do report please.

And finally, a couple of examples:
Binary sum http://pastebin.com/H4Z2Vy1h
A stack based Boolean calculator http://pastebin.com/8C5pEB23
I have some ideas. I may add an infix one soon..
[Edit] here: http://pastebin.com/bWNL2d7H - my language needs macros..

Thanks for your attention. Enjoy.
Last edited on
I've been working on a terminal emulator in C# using Gtk# for the GUI. It's... getting there. I have a todo list at the top of Window.cs. The output you see in the GtkTextView is the actual output of whatever shell you run in it (it has a list of paths to try if you don't specify one). You won't be able to interact with the shell, though; if I enable standard input redirection then the program doesn't do anything.

The reason for it is that I don't like any of the terminal emulators I've been able to find on Windows and can't run gnome-terminal on Windows.

Source code: http://www.mediafire.com/?v6s77o6yo6dr449
.NET Assembly (should work on Mono as well): http://www.mediafire.com/?4ttc65i6o14hv7h

Note: sometimes the process won't die on its own when you close the window. On Windows it usually hangs around for a few seconds and then kills itself or gets killed by windows after crashing, but I don't know what will happen on Linux, so have a proper (read: working) terminal emulator open so you can send a SIGKILL :P
Last edited on
@chris, something is wrong. When I run it on WinXP, I get "Send error report" thing. When I "mono TTYSharp.exe" in my SUSE, "/bin/bash" is printed in the terminal and nothing happens. I'll try compiling myself..[edit]Forgot I don't have gtk#. Oh well.

Oh, by the way, >:-(
Last edited on
You probably need the DLLs for Gtk# and so on. You could install Gtk# from here: http://www.mono-project.com/GtkSharp and it should work.

If /bin/bash is printed then it means that the Terminal class was constructed and started /bin/bash in a new process. I think on Linux you will need to put the DLLs in the same directory as the .exe file and you'll also need dll.config files which I don't have. Installing Gtk# would fix that.


hamsterman wrote:
Oh, by the way, >:-(

What's that for? :(

---

In other news I've been writing a 32-bit protected mode OS. It doesn't work really because I need to fix a few things but it should compile and boot (you need a compiler toolchain capable of producing ELF files and a 386 emulator).

http://www.mediafire.com/?dcq6loms3l2d11w

Edit: there are pre-compiled binaries and a pre-made floppy disk image if you want to test it.
Last edited on
Zypper says I already have a package gtk-sharp2 installed... Anyway, why did you decide to use gtk? Is it more comfortable than win forms?

What's that for? :(
Thread hijack. I don't mind, really. It would be nice if this became a place where people post their projects.
hamsterman wrote:
Anyway, why did you decide to use gtk? Is it more comfortable than win forms?

Several reasons:
1. I already knew how to use Gtk+
2. I don't think Windows Forms works on Mono (haven't bothered to check though)
3. I think Gtk is pretty

hamsterman wrote:
Thread hijack. I don't mind, really. It would be nice if this became a place where people post their projects.

Oops :/
I though that's what this thread was for. Sorry!
4. Gtk is cross platform :D
So is Mono :P
but Gtk is nicer =B
closed account (1yR4jE8b)
They are completely different things, how does that even make sense?
Seeing as Chris is making the terminal in C# on Mono Gtk's cross platform-ness isn't much of a bonus.
exactly.
It ought to be cross-platform, all I need to do is include all the dll and dll.config files. Then it should run on any platform Mono supports.
Topic archived. No new replies allowed.