Slashdot Mirror


C Styled Script - C-like Scripting Language

Exomorph writes: " C Styled Scripting (CSS) has just been released for Linux! (Already available for Windows, and OS/2) You can use CSS like an interpreter (Like Perl) or as a scripting engine within your own applications. It follows the C syntax very closely and has now been released under the GNU General Public License." Is anyone using this?

13 of 211 comments (clear)

  1. Just use PHP... by Rambo · · Score: 4

    Why do we need yet another C-like language? I use PHP now for virtually everything (using the CGI version so you can write standalone scripts) It's great for little one-off scripts or whatever. Another C-interpreter type project is EIC, which is actually extremely close to standard C. It works well for most programs you don't want to constantly recompile.

  2. So what's new? by Argon · · Score: 4

    C interpreters have been around for a long time. Have a look at Scripting with C.

  3. Moderation??? by Compuser · · Score: 4

    Why is this comment rated "funny". The guy is
    proposing using GCC as a a just-in-time compiler.
    I was thinking of doing just that for an embedded
    app where you need users to script but you also
    need real-time code. OK, so maybe not with GCC,
    but the idea is valid and serious.

  4. #!/usr/bin/perl by rhet · · Score: 4
    Uhm, yeah. A cross platform scripting language distributed under an open license? It's called Perl. And if you really want C like syntax, there's always Inline::C and CPR.

    Seriously though, do we *really* need another scripting language? We've got perl, python, rebol, scheme, csh, bash, sh, ksh, [insert favorite scripting language here]...

  5. How? And what's the point? by rjh · · Score: 4

    Remember that C is a lot more than a language. A lot of people overlook one of the most important features of the language--namely, the preprocessor. In C++, the preprocessor by itself is a Turing environment; any computing task which you can think of, you can do in the preprocessor alone just by giving it some particularly weird templates to compile.

    How does a scripting language plan on implementing the preprocessor? If it doesn't, then should it really have "C-like" in the name?

    The other issue is... what's the point? I hate to tell people this, but C/C++ are two of the worst languages on the planet. I say this as a long-time C++ hacker and C++ enthusiast: the languages are awful. There are pointers all over the place, there's God-knows how many levels of indirection, there's detailed memory management... C/C++ are so powerful because they give you such fine-grained control over every aspect of the CPU. But they're cast-iron bitches to program in, because they're so intolerant of any error.

    Scripting languages, on the other hand, are inefficient. They're slow. But they're also wonderful to program in as a result--their syntax isn't as rigorous, there's very little memory management to be had, there's no need to know the difference between the register and auto keywords, or the difference an inline amd a macro.

    A C-like scripting language seems like the worst of both worlds. You've got the pedantic syntax and attention to detail of C, and the lackluster performance of a scripting language.

    What's the point?

  6. Re:C doesn't make a good script lang. by Erasmus+Darwin · · Score: 4
    you don't want to be bothered with such things when trying to write a quick one-off script.

    However, there are more uses for a scripting language than just quick one-off scripts. As mentioned in the article blurb, this language can be embedded within your own applications to provide scripting support.

  7. C doesn't make a good script lang. by ryants · · Score: 4
    I dunno. I took a quick walk around the manual and checked out some of the examples, but it seems to me that C (or C-like languages) just aren't all that suitable for scripts. Good scripting languages (like Perl and Python) tend to be "looser" (e.g. not having to declare variables) than C, and for a reason: you don't want to be bothered with such things when trying to write a quick one-off script. Not to mention the fact that Perl and Python form some pretty stiff competition in this sort of arena.

    Also, naming it CSS is pretty confusing, given that CSS already equals Cascade Style Sheets.

    Anyways, how can I get my SourceForge project on the front page of /.? :)

    Ryan T. Sammartino

    --

    Ryan T. Sammartino
    "Ancora imparo"

  8. Do it the right way by Waffle+Iron · · Score: 4
    Let's say you want your users to be able to script your application with the C language.

    If you're a pretender, you might write a wimpy interpreted version of C.

    If you're a real software architect, however, you'd #include the gcc source tree right into your app, compile the user's code on the fly, pipe the output into a memory-mapped file, and long jump straight into the results. Damn the torpedoes.

    Make no compromises on the performance of your users' macros. If they're worthy of your program, they need the speed. If they're not worthy, they'll write some lame pointer bug and dump core; I say good riddance to those lusers.

  9. RTFLanguageDescription by jbuhler · · Score: 5

    Several of the complaints posted here about how awful C is as a scripting language indicate that people aren't actually reading the language description for CSS. Among other things:

    * Variables must be declared but are untyped.
    Like Tcl, everything appears to be a string.

    * There are no pointers (though there are
    call-by-ref parameters).

    * There is no memory management, though there
    is a way to dynamically change the size and
    dimensions of an array object.

    * There are some extensions, such as
    exception handling and string concatenation

    * There is no "goto" construct.

    * There is a limited preprocessor facility
    (#ifdef equivalents, but no macros).

    Overall, it looks like a rather nice embedded scripting language, though it's not nearly as cool as embedded Scheme :-).

  10. C interpreters by YoJ · · Score: 5
    People seem to be down on this language, so I'll go for the positive spin. After a couple minutes of browsing the manual, it looks like a cool language. It is the sort of thing you add to your program to give it a scripting language. The advantage of CSS is that it is easy to learn if you already know C (or Java). C isn't the most suitable language for scripting, and they didn't use C directly. Variables are typeless (I think), it has automatic memory allocation, etc. Of course, my favorite scripting language of all time is Lua (check it out).

    Here's something I would like to see: an interpreter for C code that follows exactly what gcc would do. Then you could make a nice GUI environment for programming, where everything happens as you type it with no compile cycle. Then at the end you compile everything to get speed.

  11. I am by volpe · · Score: 5
    And I tried to post a copy of the flamewar, which I had saved years ago. But the quality piece of software that is Slashdot replied thusly:
    Easy does it!

    This comment has been submitted already, 276100 hours , 12 minutes ago. No need to try again.

  12. Re:Not to nitpick... by sconeu · · Score: 5

    Will my computer explode if I write DeCSS in CSS?

    --
    General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
  13. Not to nitpick... by crashnbur · · Score: 5
    ...but we have enough "CSS" already. Cascading Style Sheets seems to be widely accepted. Why name a programming language, or whatever this new CSS is, something that already exists?

    Or am I just blind to some bigger picture?