Hacker News new | ask | show | jobs
by joe_the_user 5052 days ago
I'm designing a mini-configuration-language as I go along while writing a large application.

I am amazed how powerful and useful to my purpose I can make this language. Yet I would be the first to admit this the language has some fundamental flaws that would prevent it from becoming more general purpose.

So I feel like I can appreciate from the outside the effectiveness of languages which are designed to incrementally scratch itches. You can come up with a program with a fiercely loyal user base because if you've managed to roll the proper set of things that "just work". I imagine that this is the secret of both Perl and Matlab.

The only thing is I personally hate both these programs, somewhat irrationally I'll admit.

But I think it show the weakness of "grow like a weed to touch the necessary bases" school of language design. It ultimately fails for those outside the immediate target audience because they have assimilate the entire accretion process to really get the language. For a lot of situations, that feels an impudent, almost obscene demand for someone who likely comes to the language wanting to do something simple.

So I feel like that explains the rise and fall Perl. It rose with the Unix community and the web grew together and fell as more and more people felt need for a coherent general purpose language not tied to all things Unixy.

1 comments

> I'm designing a mini-configuration-language as I go along while writing a large application.

Why not just use Lua or Javascript?

Essentially I want a system where the configuration files are generally transparently editable by non-programmers. Most of the information is simple configuration information.

Lua, Javascript, VBA and other such languages might be called "configuration languages" but they're really object-automation languages. They allow a user to write standard-imperative-programming macros which address the underlying objects of a given system. They don't provide simple, clean facilities for just assigning default values to objects.

And what I have my configuration doing aside from assign default value is more-or-less filtering into and put, specifying tree-transformation commands for various inputs and output using one big, recursive loop and a bit of if-else logic. Basically, I'm producing a system which can take multiple web API sources and have them look like a single source. I began using XSLT but when I started having to also transform json, having my own transform system looked just as easy as transforming json to XSLT and then further adapting XSLT for my purposes.

I could use json or XML for my underlying data storage format but it is too verbose for easy human readability so instead I use simple ini format with just a bit of syntax added and it works quite well.