lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thanks Malkia. Yes I had trouble naming my Son and Daughter on top of this :)

Thanks Ralph and Axel.

I was trying not to clutter the list as I usually do but I can't explain the motivation quickly. The motivation for all of this to bring a new paradigm to C/Lua and hopefully build an abstraction layer over the C API. I started another thread due to the change in topic. I am not certain the premise is logical yet.

I have fallen in love with the concatenative programming paradigm. I spent a month with the Factor language. It is extremely neat but at it's current trajectory it will have been many years to move from 0.9 to 1.0, the state of similar languages is much worse.

So I was thinking, do we have to have another language for this? Lua gives us a prebuilt stack and functions don't have to take arguments and return values.

This kind of code(pseudo example):

stack_on(1, 1); add(); --> 2

might be slower but perhaps this style of programming could lead to useful code like:

quote_on(1, 5, 9, 4, 10, ); is_even() --> 4, 10

However Factor is damn near impossible to learn. Javascript might have document.blah.blah.getElementById("myHeader") but at least you know where everything lives. With these languages how do you know that dup comes from the kernel library?

So what I was thinking is that every word should be prefixed by the library it is called from but that a short form would be needed and a 100% consistent scheme would be needed too. factor has about 26K function(words actually). These tiny function can be used to build other tiny functions very quickly but again without a naming convention it becomes very hard to follow along with.

So this is why I was thinking k_dup from kernel1 or io_read() from io2, the number at the end would match the truncation of the prefix. I think this is butt ugly but quite logical.

I don't have enough experience with the C API to know if this is nonsense yet, any feedback would be great.

Thanks-Patrick