4 ms·
The four points on how "scripting languages differ from classical compiled languages" would mean even Java qualifies as a scripting language, and I've never see
by praseodym 13y ago
The four points on how "scripting languages differ from classical compiled languages" would mean even Java qualifies as a scripting language, and I've never seen anyone credibly claiming that.
Wikipedia is more clear on this: http://en.wikipedia.org/wiki/Scripting_language http://en.wikipedia.org/wiki/Scripting_language "it is uncommon to use Java as a scripting language due to the lengthy syntax and restrictive rules about which classes exist in which files" -- I'd say this applies to C++11 as well.
- drellem 13y agoI think that's the real point; c++ is becoming Java.
- alexchamberlain 13y agoEr... No! No GC and multi-paradigm.
- reirob 13y agoI'd like to add following criteria: * No static types * No need to compile * Having a REPL
- MichaelGG 13y agoF# has static types, but it feels pretty light for doing scripting. It's got a REPL and a script mode to execute things without an explicit compile phase. Perhaps "doesn't require heavy type annotations" is a better criteria than no static typing.
- reirob 13y agoAgree with you, without knowing F#. I guess F# is related to Haskell and in Haskell you have static types, but you need them only where the compiler/interpreter is not able to infer them.
- MichaelGG 13y agoF# has some inheritance from OCaml and ML. Much older than Haskell. And type inference can be done in many languages. There's no reason why, for instance, Java and C# require type annotations all over the place. They could add in type inference everywhere, although it'd probably mean a overhaul of the compiler, and it wouldn't work in every case (overloading).
- stonemetal 13y agoThere's no reason why, for instance, Java and C# require type annotations all over the place. Wouldn't their type systems be a big reason why? ML and Haskell have type systems very different from Java specifically because they went for systems that were inferable. F# has an iffy "just assume it is int" step to make it work with the C# type system. F#'s inference algorithm doesn't work as well, and it impacts how the language gets used. For example people tend to overuse the pipe operator because it helps the inference engine get the right type without annotations.
- MichaelGG 13y agoF#'s "assume it is int" is only for a few operators, such as +, as a convenience. It has nothing to do with interop with C# at all. F# inference is left-to-right, which is one reason to use the |> operator, yes. F# had additional type inference, for instance, accessing members on a binding would infer object types, but they removed that. Haskell has a more complete type inference system. I'm not seeing anything in C# that prohibits inference of types for fields, methods return types, or parameters. The type system C# has is essentially a subset of F#.
- rbonvall 13y agoawk and sed don't have REPLs, and they are undoubtedly scripting languages.
- reirob 13y agoI tend to say that sed could be considered as a domain-specific scripting language usable to edit text. awk is a more generic language - to my shame I used it only for parsing and translating text - even without a REPL you can 'test' quite a lot of constructs by providing the expressions to awk as an argument. I concede that REPLs is not a must for a scripting language, but it will definitely make it more enjoyable ;)
- edwinjm 13y agoThe definition of a scripting language is that the source code (the script) is the program.