
Katahdin - A language where syntax and semantics are mutable at runtime - iuguy
http://www.chrisseaton.com/katahdin/
======
mdaniel
I hope my master's project is something interesting like this.

However, my first thought upon reading the title of the link was about the
comments that were going to appear here: either "lisp already does this" or
"this will never be accepted as a mainstream language because it's too chaotic
to the project."

Section 4.2.3 answered the question I was searching for: what happens in this
hybrid model when an "interior" language fails to parse? It's all fun and
games to strap on a new mini langage to your source file, but it's less fun
and games when you misplace a paren. I wondered if the entire block threw a
parse exception or if the whole file failed to load. It appears based on the
skim-read that it's the later.

p.s. why is "270 version control commits" an achievement?

~~~
gchpaco
Means he used version control. (should be ordinary and expected but is quite
rare for grad student code, in my experience)

------
ngd
This was a Computer Science dissertation (by a good friend of mine). It
scratched an itch, furthered someones education and checked the box of a
required component of a degree course. I don't think it was looking to change
the world. I don't think anyone is writing apps in Kat.

~~~
mahmud
Why did he go into military service?

I don't mean to pry, but was he forced/drafted, or just a personal choice?
Seems unfortunate to me.

~~~
cgseaton
It's a huge privilege to command Her Majesty's soldiers, and something that
one can only do when young, so I went for it. Also, the leadership training
and maturity that you gain from the Royal Military Academy Sandhurst are
second to none in the world.

~~~
mahmud
Thanks for the clarification Chris; my worst fear would have been you trading
a few years in exchange for your university tuition. But seems like that
wasn't the case.

Enjoy your journey, don't forget to keep hacking :-)

Cheers!

------
colanderman
Languages such as OCaml already have the ability to do this at compile time.
What's the benefit to allowing this at runtime? (Which effectively restricts
this language to being interpreted, and severely limits the use of external
tools such as code refactorers and smart editors...)

~~~
jpr
Common Lisp does this and it's not restricted to being interpreted, you just
have to include compiler, linker etc. as part of the language runtime.

~~~
koenigdavidmj
So if I throw a bunch of Python code into a bunch of C strings and have main()
set up a Python interpreter to eval those strings, I have compiled a Python
program?

That seems like quite a copout.

~~~
jrockway
What are you talking about? That is nothing like the topic of the article or
what the parent comment is talking about.

Many Common Lisp runtimes compile things that you "eval" into native machine
code when the eval statement runs. That is what the parent is referring to.

Many other languages have different "phases" of compilation. An example is
Perl 5's BEGIN, which is Perl code that runs at compile time. This means you
can write Perl to affect the compilation of the Perl program.

(Why would you do this? Here's an example. When loading the module List::Util,
you want to be able to use its "first" function as though it was declared in
your module. You can do this because List::Util can run some code at _compile-
time_ that installs the "first" subroutine into your namespace. Then as
compilation (and runtime) continues, you will magically have that "first"
subroutine in your namespace, and the program will compile properly.

If there was no ability to run code at compile time, then importing stuff from
a module into the caller would have to be a language feature. Making the
action of running code at compile time (and installing subroutines at runtime)
makes it possible to implement this without help from the language author.)

------
p_nathan
I am strongly reminded of Perl 6 and Lisp.

I guess my question is, "what does Katahdin provide that Perl 6 doesn't"
(leaving aside the .NET integration)?

~~~
jrockway
_I guess my question is, "what does Katahdin provide that Perl 6 doesn't"_

The author with his degree?

~~~
p_nathan
Well, yes. :-) But I'm considering the language from me, a user.

------
zokier
Makes me wonder how it affects performance when done at runtime

------
drdo
How is this better than macros and read-macros?

