Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming IT Technology

C Styled Script - C-like Scripting Language 211

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?
This discussion has been archived. No new comments can be posted.

C Styled Script - C-like Scripting Language

Comments Filter:
  • by Anonymous Coward
    There is the CINT interpreter at http://root.cern.ch/root/Cint.html (unfortunately, it has limited error checking). There is also the EiC interpreter at http://www.kd-dev.com/~eic/ (better error checking). Internet C++ at http://www.xmission.com/~icvm/ is a byte code interpreter and should also offer faster compilation.

    In practice, I have not found that style of programming to be very useful with C/C++: plain C/C++ just lack the kinds of facilities that make interpreters really useful.

  • by Anonymous Coward
    I don't know about you, but I personally would rather have a programming language that has more tools available to me and be more sensitive to errors than to have those tools taken away. You can argue that things like pointers and manual memory managment make for ugly code, but I could whip up some equally ugly code in Java where these things don't exist. Obviously if youa re the type of programmer which does not want to be bothered with details of what is really going on, sure pick a language like Java. If you want to make some quick hack to automate some take, problably a scirpting language like perl is appropriate, but if you know what you are doing, I can't think of a language more versitile and usful than C/C++. They simply require that you truely understand the nature of computers to take full advantage of them. The C/C++ languages are not "awful", they simply allow for maximium control. Taking these abilities away (like Java) is like not using a hammer because you MIGHT hit your finger, if used correctly, C/C++ are amazingly useful.
  • by Anonymous Coward
    Would this have even been considered for posting if CSS were not a sourceforge project? I doubt it. No one else considered this noteworthy -- Linux Weekly News didn't cover it at all. Is this what slashdot has been reduced to: shilling for VA projects? C'mon Taco -- nip this alarming trend in the bud.
  • by Anonymous Coward
    They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.

    For CHRIST'S SAKE, give the man who said that the credits he deserves! You can't just dash around famous quotes without attributing them to someone. If you actually don't know who said it (you could also be downright evil and try to make people believe you came up with that yourself, for all I know), do a fucking google search!

  • csh, or tcsh. oddly enough the syntax is C like, and you can write scripts. perhaps it's better to load something on top of a kernel written in C and a shell written in C to get the power of C via scripts, I just don't know. Marge turn the tv down.
  • This is (almost) what is done in ROOT (root.cern.ch). Instead of #including the system compiler's source they have something which is called ACLiC. With ACLiC you can compile some C/C++ code to a shared object (.so) using your systems compiler via a fork/exec and link it in to the running code. This is done with a single simple command.

    Using the same command, minus an option, one can instead just interpret the code with CINT. This lets you trade off run time speed with compile time delay.

  • For a "real" C/C++ interpreter take a look at CINT, used extensively in ROOT: http://root.cern.ch/root/Cint.html [root.cern.ch]. It doesn't cover 100% of C/C++ but it covers a lot.

    I agree that C/C++ is not the best choice for a scripting language in general, but it does allow one to prototype fast.

  • Don't need it. Don't want it. Windows has enough problems with mail virii that make use of its scripting host setup.

    Rule #1 of making things easy - you're making it easy for everyone, including the "bad guys". Keep that in mind.
    _____

    Sam: "That was needlessly cryptic."
  • Feeding trolls, but some crack moderator modded you up.. Blame slashdot and the 120 char, it's at 112 already.
  • A quick look at the documentation
    fails to expose the expected unixizm.

    And .hss. Ugh. Overall it looks cool,
    though. And GPL'd. Won't be long
    before the warts are cured.
  • The syntax looks rather weird, its dependency on strangeNamedAndUpperAndLowerCaseFunctions makes you unnecessary work on the Shift key... It has no real language features such as pointers, structs, typedefs, etc...
    It only has one variable type (no ints/chars/whatever)... Seems like its missing all the bitops as well. Strange, off the wall language that will probably not be used much. If I wanted something for a quick script I'd use perl or shell script or even php instead of this.
  • Try html_errors 0 [php.net]

    Enjoy!

  • cast-iron bitches

    You say that like it's a bad thing.

  • OK, so maybe not with GCC, but the idea is valid and serious

    Certainly--Common Lisp has been able to do this for more than a decade. See page 677 in `Common Lisp: the Language', second edition, by Steele.
  • You've completely missed the point. In a competently designed language, equality and assignment wouldn't be so easy to intermingle. For instance, (eq a b) doesn't look very much like (setf a b), does it?

    (jfb)
  • Why? Say I want to have DSP code run in real
    time. User defines what the code does in some
    built in shell, compiler generates code behind
    the scene, dumps it to DSP then executes. For
    my purposes compile delay is not important.
    I guess I see no firm line between a scripting
    shell and an IDE.
  • 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.

    Hrm. I found this particularly useful when doing AI stuff in Lisp. I'm surprised no one has done it for C yet, it would be a lot handier than having to recompile/start the debugger any time I get a "show-stopper" error. It would be nice to have known it as I was typing it, with nice messages like "you have over-shot your array boundaries again, dumbass. Please stop coding at 4am".
  • That is an important difference! :)


    On a visible but distant shore, a new image of man;
  • Yeah, I actually use Pike, but I've never actually written anything in C, so I wasn't sure how close they really are.


    On a visible but distant shore, a new image of man;
  • How is this different from EiC [pobox.com]? Is it supposed to be better in some way?


    On a visible but distant shore, a new image of man;
  • There's no need to #include the gcc source tree, and the memory mapped file is just a waste, and means you have to think about the security aspects of the temp file. Just read it in via stdio and copy the data to a set of mmapped pages. You need the copy because you don't know ahead of time how big the program will be, thus how many pages you need to mmap.

  • If you want something like this:

    #!/usr/bin/ccscript
    /*
    * My C program here...
    */

    and you don't mind terrible performance, then
    you can just write a shell script "interpreter"
    which simply runs gcc on your program.

    #!/bin/sh
    # ccscript:
    tmpdir=/tmp/tmpdir.$$
    rm -rf -- "$tmpdir"
    mkdir "$tmpdir" || exit 1
    tmpobj=${tmpdir}/obj
    tmpsrc=${tmpdir}/src.c
    tail +2 "$1" > "$tmpsrc"
    cc -o "$tmpobj" "$tmpsrc"
    $tmpobj
    exitval=$?
    rm -rf -- $tmpdir
    exit $exitval

    I expect that this CSS program would run a lot
    faster, though. :)

    - Kevin
  • Like PHP, ASP, and JSP.
  • Someone should write a tool to find and erase all copies of this thing on a host. Wonder what such a thing could be called?
  • Ways not to have an impact on computing...

    1) Define a new project with the same goal as multiple established projects.
    2) Select a name that is already accepted for several other technologies.
    3) Post it to Slashdot.

    Lenny
  • I doubt there'll be much confusion, because I doubt too many people will bother with this. So when someone cays 'css', I think the safe assumption is that they're talking about 'cascading style sheets'.
  • Uh...lemme remind you -- almost EVERY scripting language (besides shells, and perl was labelled a "shell" language) was originally meant to be used to just add embedded scripting. Tcl/Tk was NEVER meant to actually write whole applications of 20-100Klocs. However, that's exactly what happens. People judge a scripting language based on its limitations to the extreme ends -- how much overhead is involved in the interpretor for "hello world", and how large a program can I really build just relying on the built-in libraries and still be fast enough to be useable.

    As for C-like embedded scripting, ECMAScript is darn close (some java-like things such as some OO support, and every object has toString()), and Mozilla has embeddable interpretors of their Javascript implementation for both C and Java. I prefer ECMA/JavaScript 'cause of its OO. Its not secure encapsulation (e.g., "information-hiding"), but it at least gives me encapsualtion.

    Mind you, I'm still in the reading-stages of learning [PJ]ython, 'cause I haven't had the time to really write something yet.
    --
    You know, you gotta get up real early if you want to get outta bed... (Groucho Marx)

  • Even asking the question betrays some mental habits I wouldn't be comfortable admitting that I had. The answer, of course, is choice. The corresponding question, "Why doesn't everyone use my favorite language?" is also easily answered: Everyone isn't like you -- or anyone else.

    Personally, I love C, and I think any language that doesn't give you pointers and low-level control with the accompanying ability to shoot yourself in the foot if you don't pay attention is an underpowered piece of crap. That is, however, just my personal opinion based on my own history and needs, and I don't expect everyone else to adopt it. I certainly don't go running around every time a new language comes out asking, "Why do we need a new language? We've already got C!"

    Conformity is a wretched mental habit. It may have its uses in a business environment, but I'd think the Slashdot crowd, if no one else, would be clued into the fact that some people program for pleasure, too. You'd also think that programmers would have a better understanding of the pleasure that comes from successfully doing something difficult.

    --

  • CSS bashers should have taken the time to click on the link to IBK [ibk-software.ch]. This software is not done on a lark, it appears to be an integral part of Peter Koch's business. Thus it is insulting to insist that the developer should have spent his energies on a more worthwhile project--his energies are being spent directly on his business. Looking at the technical aspects, his porting to OS/2, Windows, and Linux appears to tie in with the other product advertised on the IBK webpage, the Business Process System. Thus people who bash the developer for releasing a "new language" are totally missing the point--this developer has chosen to make available to the entire community his knowledge under the GPL. Hopefully this will reflect back to him in increased publicity and business contacts. The release of CSS is an increase to the community. Had the developer been discouraged from releasing, he would have had no incentive to have contributed to any other project.

  • #warning this program considered harmful

    #ifndef foo
    #define foo 0
    int main (void) { return 0; }
    #endif

    #if (foo == 0)
    #undef foo
    #define foo 1
    #include "foo.c"
    #elif (foo == 1)
    #undef foo
    #define foo 2
    #include "foo.c"
    #elif (foo == 2)
    #undef foo
    #define foo 3
    #include "foo.c"
    #endif

    --
  • It's possible to do iteration with the C preprocessor. One example of it is http://www.ioccc.org/years-spoiler.html#1995_vansc hnitz [ioccc.org]

    It is basically a file that #includes itself. Don't know if it's Turing complete though.

  • I prefer to write applications in Perl or Python, myself. Once the app is at a usable state, I run it through a profiler to see where the bottlenecks are. If the bottlenecks can't be opened up by tweaking the code and algorithm, then I code the bottlenecks in C or C++ and call them from Perl/Python.

    Code spends 90% of its time in the same 10% of code. So this technique actually winds up working pretty well.
  • Many compilers do honor the register keyword. They don't automatically store the variable in a register, but the variable does get marked as needing a high degree of optimization.

  • The only thing I don't particularly care for about GUILE is that it's a bit LISPish... still.

  • Heh. I thought you meant Top-Level Aggregation [ietf.org] identifiers. There are only 2^13 of those. 8-)
    ------
  • Would you prefer to use Perl as a general-purpose language?
    ------
  • Learning curve.
    ------
  • In C++, the preprocessor by itself is a Turing environment

    Huh??? The pre-processor has no concept of iteration. I.e., you can't loop. Please provide some proof, or cite some reference, which shows that the C++ preprocessor (just C++? is the C preprocessor substantially deficient relative to C++?) is equivalent to a Turing machine.

  • (e.g. compiling "if (a=b)" as "if (a==b)" because of course he "meant ==").

    Yes, but in a well-designed language, "a=b" and "a==b" wouldn't both be completely legal and yet have completely different meanings.

  • That version came from Bartlett's, as posted on Bartleby [bartleby.com].

    Specific quote ref is here [bartleby.com].

  • I Know it's Ben Franklin. The fscking 120 character limit hit me, dude.
  • "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. "

    Gee, it's a good thing PHP [php.net] doesn't look at all like C [php.net], or have stdlib like [php.net] fuctions, eh?
    --
  • Same reason Javascript and Java have similar names: to steal existing Mindshare.

    I love acronym abuse and polution! I would have thought intelligent people could avoid such unexcusably stupid decisions.
  • Intercal [tuxedo.org] is the ultimate interpreted language. We don't need any others.

    Your assignment for next week is to try to convince your boss to rewrite the entire project in Intercal.

  • How is this different from EiC? Is it supposed to be better in some way?
    Well, the CSS site can handle the slashdot effect. The EIC site crumpled before this story had 50 comments. :)
  • Not to mention the MPAA's favorite CSS... It's kind of like George Foreman naming all of his kids George. It works for him, but it confused the hell out of everyone else.

  • You CAN use (more or less) exact C syntax in your perl scripts (all but the declaring, and libs part)... If you know C, you can move to Perl in the matter of 1-2 hours.



  • Let's move to unicode.

  • Fair enough? But which language would you prefer?
    I know I am putting my head up for the turkey shoot here...but I have really become a Java fan in the last three years for general applications, and especially enterprise software.

    Of course, if you are writing a device driver or something that has to milk every last cycle and use memory like it is gold, then use C, or even assembler.

    If you just need to prototype some forms in a few minutes (dare I say it?) break out icky old VB.

    Anyway, as a C developer for most of a decade, and then a C++ developer for a half-decade more, I have been totally spoiled by Java. Let me count the ways...

    I haven't had to chase a runaway pointer for years.
    Pure interfaces and runtime class loading make it easy to move beyond traditional object-oriented development to "component-based" development with pluggable component implementations.
    Exception-handling works. (I know, that is an implementation issue, not a gripe against C++ itself. But using MSVC on Windows 5 years ago, we didn't dare try and catch.)
    It is much easier to make puns with "Java" than with "C" or "C++."
  • The fact that Windows has scripting is not a problem. Gnus [gnus.org], an Emacs mail/news client, will automatically execute scripts for you if it receives an attachment of the MIME type application/emacs-lisp. These scripts have full access to the entire elisp environment.

    The key difference is that Gnus will display the code for the script and ask the user: "do you want to execute this script?". You don't see any Gnus mail virii, do you?

    --

  • True, in Perl you don't have to declare variables. But good Perl programming is done with "use strict". I'm not an expert Perl programmer, so correct me if I'm wrong, but "use strict" requires programmers to be a little more careful to prevent errors. Variables must be declared in scope (global or local with my), along with other restrictions. Granted, you don't have to declare a datatype (other than indicate it's a scalar, array, or hash).

    The things that seem to make Perl a great scripting language is that the syntax is moderately human readable (though it does have many symbols that can be confusing to newcomers). Also, Perl has great modules for CGI and text parsing, so that programmers don't have to reinvent the wheel. This makes many common CGI tasks a snap in Perl, while it may be more difficult in C (or a C scripting language).

  • The CSS scripting language is a intergral part of the PDP++ Neural Network software. I currently use PDP++ for research any find that CSS is a very convenient way to setup and run simulations. This is opposed to other large ANN packages such as the Stuttgart Neural Network Simulator (SNNS) which uses its own scripting language that is a mix (or rather mess) of awk, Pascal, Modula2, and C. So I don't have to learn a new language to use my software. Also, PDP++ is a completely object oriented and you can manipulate the objects in the system very effectively with CSS. However, I wouldn't (and don't) use CSS for everyday scripting tasks. If you want to embed a fairly robust scripting language with familiar syntax into your systems then CSS is the ticket, otherwise stick with Ruby or Perl.

    -- DieZeugen
  • Aside from the issues surrounding yet ANOTHER computer related technology named CSS (cascading style sheets and content scrambling system (DVDs)) what exactly is the advantage to a c-like scripting language? It would seem to me (and to anyone who had done a substantial amount of scripting and C programming) that the entire philosophy and modus operandi of C and scripting languages are completely and utterly different. Moreover, what precisely is wrong with the (myriad) scripting languages we have now? Are there those who cannot find something among bourne shell, awk, sed, perl, python, and others that they can understand and use? Perl 5 is about as easy a language to learn as exists, and Python is about the same. I don't see a valid niche where this new beast might make a happy living. It's simply redundant and unnecessary.
  • I've determined that "C-like" really means just the following:

    1. Uses curly braces to delimit logical code blocks

    2. Uses lowercase statements for control flow (if, while, for, switch)

    3. The 'for' statement is not a proper looping or interation statement, but is just a "while++"

    4. The 'switch' statement is horribly limited to compile time numeric constants and requires you to remember to 'break' after each case, which is braindead.

    5. The language relies on libraries of functions to do anything useful (printf, scanf, getchar, fopen, etc, etc)

    6. Ends logical lines with semicolons.

    And that's about it. When you see "C-like", they tend to be talking more about form than function, to be honest. And they certainly NEVER mean any of C's ugly (but of course powerful) sides, like pointer arithmetic, massively complicated typed variable declarations on one line, a preprocessor that can easily obfuscate meaning from simply examining the code with human eyes, etc, etc.

    Quite frankly, C got so far as it did because it was VERY fast, and very powerful if you knew how to weild it... and these things were very important when you had little memory and slow processors to work with. To be honest, the design goals of C make almost no sense any more. And C++ (a language I've worked heavily in for 8 years) is an abomination these days. So complicated it literally takes YEARS to become truely proficient, and designing and implementing huge systems in it is pure torture. Languages like Java and the like are here to take advantage of the ever increasing cheapness and availability of CPU and memory (and disk). They simplify life dramatically, speed development, get rid of complicated maintenance of separate header and code files, compile lightening fast, report errors better, have fewer ambiguities and problems, and do the job "fast enough". Ditto for all the scripting languages around.

    So frankly, it's getting to the point where being EXACTLY like "C" isn't a selling point on ANY level. Being "C-like" sorta helps a transition from a 'habit' sort of point of view, but really isn't that necessary any more.

    - Spryguy
  • It seems to me that the primary purpose of making a new general purpose language (scripting or compiled) should be to improve on what has come before.

    Therefore a new language may differ significantly from past languages.

    Does CSS offer any significant new advancements? If not, then why bother? We have plenty of scripting languages. Some bad, and some excellent.
    --
    "Linux is a cancer" -- Steve Ballmer, CEO Microsoft.
  • I agree.

    Today, there is no wisdom to use Pascal as the only teaching language -- and I wouldn't even make Pascal a major focus.

    One could argue, Pascal is still good in teaching environments where you want to compile to native code. Although there are other, but less popular choices, such as Modula-2.

    By the time students reach the stage where they write performance critical code (i.e. calculate the mandelbrot set), they can probably use C/C++ or something mainstream.
    --
    "Linux is a cancer" -- Steve Ballmer, CEO Microsoft.
  • As convenient as it must be for die hard C programmers to write shell scripts in a C like language, honestly it would seem to me that they could pick up perl in a day and any shell scripting language in a couple of hours. In fact I would be shocked if they haven't already. And as much as I appreciate the freedom of innovation that people think they have creating new programming languages, just because they found another way to spell FOR doesn't mean they have the right to give birth to language. The people who are coming up with these web languages and scripting languages that pop up on freshmeat probably dream of the day when their language has their own O'Reilly animal/vegatible/other book. But do they really make the computing world a better place? Sure some languages with good ideas can start from no where and build momentum, like PHP for example. But it was innovative for its time, with its preprocessor inside of apache. And then it kept on innovating. Rebol is another example, probably the easiest language to get accustomed to, ever. You can change the language to your own syntax. That's some kind of an advance. That's what really needs to be the test for a new language. If you're not doing something new then what's the point? Personally I'm waiting for ASM-shell, why use perl to do assembler's work. Perhaps I'll try to write it myself. Then maybe someday I can get the chupacabra on my language's O'Reilly Book.
  • I hesitate to make this comment on Slashdot, but since this crayon character brought it up. . .
    Pascal predates C by decades and its maturity is obvious to anyone who uses in for any length of time. As we all know, the orignal Mac up to System7 was done in Apple's ObjectPascal and there are still various development tools that rely on Pascal based scripting including Borland and several other Windows based development environments.
    I'm not saying Pascal is better than C all around, but when it comes to scripting a user interface that simply calls upon functions written in a lower level language, I can't see the point of using anything else other than simple ignorance of the alternatives.
    In educational multimedia, Pascal is king. This is an ugly market to a lot of slashdotters as it is a market where a lot of content experts rather than nerd-core geek "programmers" publish software with emphasis on ease of use. But if Linux is to really take market share from MS in the education market, there will have to be better Pascal-based development tools for making quick and easy user interfaces.
    So, yeah, this idea sounds like a misguided student project which further underscores my point about getting better multimedia scripting environments for Linux into education.

  • For scripted control of setup and execution of Windows programs, including tasks in DOS windows, C Styled Scripting seems excellent.

    Auto-It does this, and it is free, but it is not open source: http://www.hiddensoft.com/AutoIt/ [hiddensoft.com]

    Wilson WindowWare's WinBatch does this, and it is comprehensive, but it is not-free shareware, not open source, and I have had problems with poor documentation and poor technical support: http://www.windowware.com/ [windowware.com]


    Question: People who write open source software often pick poor names for their work. Why is that?
  • Or does it mean Content Scambler System... Does this mean that DeCSS now has uses beyond the access clause of the DMCA? Man I am confused....

    Here is another way then to annoy the MPAA-- create a Deconstructor for CSS and call it DeCSS... Then when they complain, simply leave it at "I fail to see how your complaint has anything to do with the software at hand..."

  • Maybe we could stay with the 'C' language concept of adding plusses to change the name. This would be:

    CSS++

    Has a nice ring to it.
  • What does this add to Hey, if C were appropriate for scripting, people would use it that way. Why won't these folks just let systems languages be systems languages, and scripting languages by scripting languages?
  • This isn't a flame of the GPL in general, just the realities of the world given this type of software. Something like this should probably be released with a more general license. LGPL, if you want to stick with the GNU crowd. How many *successful* embeddable-focused GPLed scripting systems are there? Uhm, none.

    Of course, in the end the choice of license is completely up to the author of the software... so be it.

  • I'm not an expert Perl programmer, so correct me if I'm wrong, but "use strict" requires programmers to be a little more careful to prevent errors.

    This is certainly true, but having to do such thing all the time would be a drag... if I'm writing a PERL script that is going to be around for a while and maintained by others, I usually go with "use strict". If I'm just writing a quick one-off to do some specific data munging (or whatever), I can be as sloppy as I want. I suspect this CSS won't be as forgiving.

    Anyways, maybe "not having to declare variables" was a bad example. Perhaps a better example would be more natural reg. exp. usage in Perl and Python, whereas this CSS seems to make use of a clumsy library, and other areas where Perl and Python have things "built in" that this CSS doesn't.

    Ryan T. Sammartino

  • Remember... there are only 17576 three letter acronyms, so we're bound to start overloading them at some point.

    Ryan T. Sammartino

  • Errrm, "is" not the same as "==" in Python in all cases. "==" will check for equality, "is" checks to see if they are the same thing. When you're talking about objects, there is a difference.

  • I can't wait for my tee shirt featuring DeCSS in CSS!!
  • Wow, it looks like another scripting language is coming out every couple of months, I'm amazed! I wonder just how long it will be before they run out of compiled languages to mimic and they start making hybrid scripting languages. I can see the articles headlines now: "Visual Pyavel Basic++ combines the flexibility of Perl, the power of Python, the simplicity of Java, the comment syntax of Visual Basic, and a few operator overloading doohickeys from c++ (just for good measure) to make the world's ultimate scripting language! Get your copy today (Warning, a source code download is only available through CPAN#...)"

  • You've brought up a valid point, but I believe you are hedging a little too closely on the differences between scripting and engineering. Both require different skill sets (though many an engineer knows scripting and vice versa), so you can hardly compare the [dis]advantages of either a scripting language or a truly compiled language (like C/C++). For example, how would you hope to write a device drive in Perl? Or why would you bother to write a basic parsing utility in C? Truth be told, C and C++ are the finest languages for programming ever implemented (notice I didn't say conceived).

    With languages as complex and daunting as these, it's up to the coder to get a handle of things. They don't pay us upwards of 6 figures for nothing. I find it interesting, by the way, that you mention C/C++'s intolerance for error. In C there isnt' much you can do aside from check for NULL pointers, etc in hopes of catching situations before they go awry. I'll give you that. In C++, however, we're given a rather robust exception handling mechanism. The only chore involved is learning how to properly use it (and in my time I've noticed few engineers truly do.) Additionally, in C++, your annoyance with pointers are solved by references.

    I can tell, however, that you haven't spent much time in assembly. You'd probably bust a vein in your forehead over ASM's intolerance for errors.

    Honestly though, you'd be hard-pressed to find any language better suited for a good 99% of all software development problems (and I'm not talking about pretty GUI driven database apps). :D

    -[McP]KAAOS
  • And as much as I appreciate the freedom of innovation that people think they have creating new programming languages, just because they found another way to spell FOR doesn't mean they have the right to give birth to language.

    Having lived through the little-language-dark-age (call it mid-eighties to early nineties), when it sometimes seemed like C and BASIC would drive out everyone but Chuck Moore, Ralph Griswold, and few Lisp hackers holed up on a farm in Montana, I am glad (no, strike that, I'm ecstatic) to see all the effort going into new (and sometimes not so new) languages. Carl, Larry, Guido, Peiter, and the thousands of others whose names don't spring to mind at this instant have my heartfelt gratitude. Personally, I'd much rather live in a chaotic world of plenty where, no matter how I want to spell "FOR", there's a language for me.

    -- MarkusQ

  • one of the major holy wars on Usenet a few years ago:

    csh considered harmful? Is this a reincarnation of the C-shell, but now we can run it everywhere? Good Ole' Bill Joy will be happy.

    OK, I'll admit I didn't read the article, and I bet it has nothing to do with the infameous csh, but I'd thought I'd mention it anyways.

  • I read the sourceforge pages on "CSS" and I can find no compelling reason to switch to this language for scripting over any of the excellent scripting languages that already exist. It does not have any unique compelling features that I can see, other than "it looks like C".

    There are already so many scripting languages available that a new one needs to offer some compelling feature. I'm running down the list of "CSS" features..

    C syntax: Not really a feature. If you are a C programmer I suppose having something familiar is a bonus however.

    Sophisticated error handling by exceptions - Perl, Python, and Ruby already have this.

    High performance database libraries - Perl already has the very sophisticated DBI database interface. Python is at version 2.0 of its database API specification. A DBI interface is currently in development for Ruby.

    Automate regular tasks or build application benchmarks with the outstanding windows control library: Perl, Python, and Ruby already have good windows integration.

    Develop libraries to meet your special requirements using your favorite C/C++ compiler: Perl, Python, and Ruby can all be extended via C and/or C++

    Develop libraries to meet your special requirements using your favorite C/C++ compiler: Ruby is embeddable in C applications. Python is embeddable in C and Java applications. Perl is weak in this area, but I believe Perl 6.0 is supposed to be easily embeddable.

    Write CGI programs for your web server: You can write CGI in numerous scripting languages already. In addition, mod_perl allows you to directly access Apache's module API to write extensions to Apache itself. Then of course there is PHP although I do not consider PHP a general purpose language. Pike / Roxen is a viable contendor in this area as well.

    A major feature that I see missing in "CSS" is OOP. Python and Ruby, two of the newer generation scripting languages, have very powerful OO features. Ruby is object pure... everything in the language is an object that is extendable down to basic types like strings and integers (similiar to smalltalk).

    From my perspective using "CSS" instead of one of the next generation scripting languages (Python and Ruby) is a giant step backwards. In addition, the old mainstay Perl is a very mature language with an unparalleled library of available modules for it. What is the incentive for using "CSS" other than the novelty of having a C like syntax?

    By the way, the name "CSS" was a HORRIBLE choice.

  • by kinkie ( 15482 ) on Sunday July 01, 2001 @10:50AM (#117569) Homepage
    Take a look at Pike [roxen.com], it's been covered here in the past.
    It has a c-like syntax, it has the preprocessor, and it has classes (full OOP), functional programming if you want, a nice runtime library. It doesn't have pointers, but it has references (no arithmetics though), and high-level constructs for strings, sets and associations. It does manage memory quite fine (refcount + garbage collector) and you can make it as pedantic as you want, even not at all (just use the mixed type everywhere).
    This said, you won't get rid of the C syntax anytime soon. It has an advantage over most other syntaxes one can come up with for an imperative language: it's concise. And if used with some discipline, it can be very readable which is one of the most important requirements for a programming language. By adhering to a c-like syntax, any other programming language can be instantly readable by a lot of people.
  • by account_deleted ( 4530225 ) on Saturday June 30, 2001 @11:44PM (#117570)
    Comment removed based on user account deletion
  • by Louis Savain ( 65843 ) on Saturday June 30, 2001 @07:09PM (#117571) Homepage
    The world does not need another scripting language. Enough is enough!
  • by Amokscience ( 86909 ) on Saturday June 30, 2001 @09:00PM (#117572) Homepage
    Embedding scripting language into programs... you mean like SWIG?

    http://www.swig.org/
  • by Pedrito ( 94783 ) on Sunday July 01, 2001 @08:17AM (#117573)
    Choice of programming languages comes down to what fits your needs and what fits your skills.

    I've been programming in C++ for 7 or 8 years, and find it to be fantastic for expressing what I want to produce. I find it much easier to write code that's easy to debug and maintain than any other language I've ever dealt with.

    Now, granted, a lot of that is due to a very detailed process that we go through before even writing the code, but well designed C++ systems can be quite easy to maintain.

    I've written several large systems in C++ and found it to be very easy to maintain and debug. My last major system had over 150 classes in a very well designed architecture. Although more than 30 people were involved at various times during it's implementation (over a 5 year period), in the end, there were two of us maintianing it and adding new features. And when I say new features, I'm talking about major additional functionality.

    Now, could Java do what this system did? Yes, but probably not at the same speed. This was a very mathmatically intensive system. It modeled cellular telephone networks (the antennas at base stations as well as the mobile phones).

    I still like C++. I like it a lot. It has made my life much easier. Until I find a language that's going to make my life easier, I have no intention of changing.

    That said, is C++ the best language for every task? Of course not, and I certainly don't use it for web scripts. Everyone has their own reasons for choosing a language, though, and as I'm very C++ oriented, a C style scripting language would probably be very easy for me to adapt to. Perl sure as hell wasn't easy for me to adapt to.

  • by portege00 ( 110414 ) <[npbradshaw] [at] [yahoo.com]> on Saturday June 30, 2001 @06:11PM (#117574) Homepage
    Am I the only one who's going to look at people funny now when they say CSS. Do they mean Cascading Style Sheets, or this? Argh, the headaches! CSL would've been better: C Scripting Language. Hey, that's practicality!
  • by paulschreiber ( 113681 ) on Saturday June 30, 2001 @07:29PM (#117575) Homepage
    take a look at this article [perl.com] on perl.com.

    you'll see that Inline::CPR lets you do this.

    #!/usr/bin/cpr
    int main(void) {
    printf("Hello, world\n");
    }

    tada! interpreted C.

    Paul

  • by YakumoFuji ( 117808 ) on Sunday July 01, 2001 @06:05AM (#117576) Homepage
    I've been using 'Small' for a fair while now, here [compuphase.com]

    from the site;

    Small is a simple, typeless, 32-bit extension language with a C-like syntax. A Small "source" program is compiled to a binary file for optimal execution speed. The Small compiler outputs P-code (or bytecode) that subsequently runs on an abstract machine. Execution speed, stability, simplicity and a small footprint were essential design criteria for both the language and the abstract machine.

    • Small is a simple, C-like, language.
    • Small is a robust language with a robust compiler.
    • Small comes with an implementation of an abstract machine in portable C. The abstract machine is a set of C functions that you can easily link to an application or function library. By compiling the source code to P-code for an abstract machine (or "virtual machine"), Small is much faster than pure interpreters.
    • Small has a good interface to native functions (in C/C++); your application calls functions from -Small programs, Small programs call functions from your application.
    • Small is a 32-bit language, even when compiled with 16-bit DOS tools.
    • For porting purposes, Small is written in ANSI C as much as possible; Big Endian versus Little Endian is handled. -Small is quick (especially with Marc Peter's assembler implementation and/or his "just-in-time" compiler) -Small is, er..., small.
    • Small is free and it has a liberal license (you may use it for commercial applications, and you may also freely distribute modified sources or binaries ---though you take responsibility for those modifications).


    Write your Own Operating System [FAQ]!
  • by istartedi ( 132515 ) on Saturday June 30, 2001 @08:13PM (#117577) Journal

    I can't believe I had to read this far down to see a mention of EiC. First, and this is important...

    ...one of the best things about EiC is that it is NOT merely "C-like". EiC tries to follow the ANSI/ISO standards as closely as possible and does a very good job of meeting C90. Last I heard, C99 support was in the works.

    Whenever I hear "C-like" I always get suspicious, and it almost always turns out that the syntax is not true C. Based on what other people are saying, it looks like the article is mentioning yet another one of those, and if that's true I have no use for it.

    As for the people who are wondering why people want scripting in standard C, here are my reasons:

    1. Code re-use. With a babel of scripting languages, you are duplicating functionality at times. When you do your scripting in C, you can take ideas that started out as scripts and easily incorporate them into powerful programs at a later date. Likewise, you don't have to translate the large body of C source code floating about into some other language--you can just use it.

    2. Rapid Application Development, which ties in closely with point 1.

    Long live C! Although I haven't actually tried it, I plan to use a C to Java translater, make, and javac to build Java applets without actually writing Java.

    The only new language I want to see is a metalanguage analogous to PBM so that I can maintain all my code in C, run CtoPBMlang and PBMlangtoFOO with make to build for whatever scripting environment is required.

    It's funny to think that programmers are trying to write translaters for human languages. We don't even have reliable automatic translators for the far simpler languages that we have invented for programming!

  • by Laplace ( 143876 ) on Saturday June 30, 2001 @10:24PM (#117578)
    The Template Metaprogramming mentioned in other posts illustrate the power of templates. While there may not be a facility for looping in the "linear iterative process" (see "Structure and Interpretation of Computer Programs for a definition) sense, there is in the "linear recursive process" sense. What happens is the proprocessor expands the templates. If a template has a template as a parameter, the embedded template is also expanded. This continues until an atomic (terminating) parameter is passed or until the preprocessor runs out of steam. Of course, for this to work on compilers like gcc, you need to increase the -ftemplate-depth-xx to obscene values. Since the preprocessor expands the code into new, legal, C++ code, you can write very fast loops. This is because the loop is unrolled, and you have explicit code (that the preprocessor wrote from your instructions) that usually smokes its competitors. Now for the obligatory link: Go to the Blitz++ [oonumerics.org] web page to see a nice example (and some interesting papers on the subject).

    The thing I find amusing about this is that languages like Lisp provide this exact functionality without the truly cryptic syntax (although you could argue that parentheses are replaced by angle brackets).

  • by depsypher ( 177056 ) on Saturday June 30, 2001 @08:33PM (#117579)

    Ok, first of all why would you want pointers in a scripting language? It's a SCRIPTING language we're talking about here!!! Scripting languages are supposed to be an easy way to expose the functionality of a program, not a tool to create security holes and logic errors. Introducing pointers into something like this will create more bugs (both intended and accidental) and be a major pain in the butt for the script programmers to deal with.

    Also, since when is goto a major feature of C? One of its very few legitimate uses is to break out of a deeply nested loop. Ok, so other than this one use (which optimizes some code only some of the time), what is it good for?

    Finally, #defines are a nice feature of c, but again, this is a SCRIPTING language. If you just need a constant, declare one const. If you need a function that returns the bigger of two numbers, write the function! I fail to see what features they've left out that are really needed in a scripting language. p.s. I do agree with you that CSS is a pretty bad choice of acronyms.

  • I've never understood the wisdom of using Pascal for teaching.

    The wisdom of using Pascal for teaching was before there were Modula-2 and Oberon.

    Pascal was a great teaching language when there was Fortran and C. Late 70's, early 80's.

    Vendors extended Pascal enough to make it commercially useful. Thus creating many incompatible dialects.

    Modula-2 corrected many Pascal mistakes. But by that time C had achieved a lot of mass on the PC.

    A serious Pascal design mistake that Modula-2 corrected (and C did correctly already) was NOT to design I/O primitives into the language, but rather make them part of the standard library.

    As for today, there are far better teaching languages. Most young 'uns today were wearing diapers when some of us were learning Pascal/C/Modula-2/MS-DOS/Lisa/Macintosh, etc.
    --
    "Linux is a cancer" -- Steve Ballmer, CEO Microsoft.
  • by ryants ( 310088 ) on Saturday June 30, 2001 @07:39PM (#117581)
    > Please provide some proof, or cite some reference

    Well, you can do template metaprogramming, but I believe it involves a little more than just the preprocessor. For example:

    template < unsigned N > struct Fact
    {
    enum { Val = N * Fact < N - 1 >::Val };
    };

    template <> struct Fact < 1 >
    {
    enum { Val = 1 };
    }

    #define FactT( n) Fact < n >:: Val

    Conforming compilers will reduce FactT(5) to a constant.

    References:

    * Chapter 1.2 of "Game Programming Gems" (that's where I got the example from)
    * "Using C++ Template Metaprograms", C++ Report, May, 1995

    Pretty whacky eh?

    Ryan T. Sammartino

  • by Jennifer E. Elaan ( 463827 ) on Saturday June 30, 2001 @07:47PM (#117582) Homepage
    This is actually in reference to the C++ template facility, not the old carry-over C preprocessor that is left in the C++ environment. The template system can actually do some looping if you're careful, it has to do something with using recursive template calls with an end-cap, similar to how you do loops in M4.

    I saw a paper a while back on numerical computing (I tried to look it up, but alas, I don't remember enough of it) that used these kinds of tricks to do all kinds of neat numerical analysis while compiling. Strange use of templates.

    -- Blore's Razor:
  • by Rambo ( 2730 ) on Saturday June 30, 2001 @06:16PM (#117583)
    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 [kd-dev.com], which is actually extremely close to standard C. It works well for most programs you don't want to constantly recompile.
  • by Argon ( 6783 ) on Saturday June 30, 2001 @07:24PM (#117584) Homepage
    C interpreters have been around for a long time. Have a look at Scripting with C [itworld.com].
  • by Compuser ( 14899 ) on Saturday June 30, 2001 @09:22PM (#117585)
    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.
  • by rhet ( 29034 ) on Saturday June 30, 2001 @06:17PM (#117586) Homepage
    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 [cpan.org] and CPR [cpan.org].

    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]...

  • by rjh ( 40933 ) <rjh@sixdemonbag.org> on Saturday June 30, 2001 @06:36PM (#117587)
    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?
  • by Erasmus Darwin ( 183180 ) on Saturday June 30, 2001 @06:35PM (#117588)
    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.

  • by ryants ( 310088 ) on Saturday June 30, 2001 @06:14PM (#117589)
    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 [sourceforge.net] on the front page of /.? :)

    Ryan T. Sammartino

  • by Waffle Iron ( 339739 ) on Saturday June 30, 2001 @06:55PM (#117590)
    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.

  • by jbuhler ( 489 ) on Saturday June 30, 2001 @06:49PM (#117591) Homepage
    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 :-).
  • by YoJ ( 20860 ) on Saturday June 30, 2001 @07:18PM (#117592) Journal
    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 [puc-rio.br]).

    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.

  • by volpe ( 58112 ) on Saturday June 30, 2001 @08:15PM (#117593)
    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.

  • by sconeu ( 64226 ) on Saturday June 30, 2001 @09:09PM (#117594) Homepage Journal
    Will my computer explode if I write DeCSS in CSS?
  • by crashnbur ( 127738 ) on Saturday June 30, 2001 @06:14PM (#117595)
    ...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?

Two can Live as Cheaply as One for Half as Long. -- Howard Kandel

Working...