Tag Info

Hot answers tagged

65

When you have behavior that you don't want to have to recompile the program in order to change. This is exactly why so many games use Lua as a scripting/modding language.


34

I would argue that a scripter is a programmer, scripting languages are still programming languages :). Some will argue that you're only a programmer once you've picked up your first non-scripting language. Your Mileage May Vary comes to mind here. Some will also argue that a scripter has no formal methodology/training behind them, in that case those ...


30

None. Scripting languages ARE (a subset of) programming languages. From Wikipedia: A scripting language, script language or extension language is a programming language that allows control of one or more software applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language ...


28

This technique can be used to implement core logic that is easily portable between different language environments. For example, I have a calculator simulator where all the internal calculator logic is implemented in 100% JavaScript. The user interface code is of course different for each platform: Web browser (JavaScript) iOS (Objective-C) Windows (C++ ...


26

Simple : Lua have more "niche" objectives than Python. Python is thought to be useful as a general programming language. So, it's useful in a lot of cases. It covers many well known types of application but doesn't enter directly into competition with other languages that might be targeted at specific constraints, but the simplicity of it's syntax. Lua is ...


25

I disagree. First, scripting languages are at a higher level of abstraction, and there is nothing wrong with this. At the beginning one is just trying to learn the principles. Actually I would say that choosing a lower level language may encourage bad coding, since one has to deal with some details before being able to understand them. Instead with a simpler ...


22

The main difference is in how they are used. Scripts are typically quick and dirty. Say, a bash script to make your life easier. Whereas a 'programming' language is meant to be much more thought out and deliberate. That's not to say that you can't do that with a 'scripting' language. You can make full-blown GUI applications (or web app) with python as ...


21

There's certainly no technical reason such a thing couldnt exist. There's nothing particular about client-side code that mandates the use of dynamically typed languages.


21

It doesn't matter where you start. It matters where you go after you start. BASIC may not be the most elegant language on the planet, but it encompasses the fundamentals of procedural programming, and that's enough to get started. I started with BASIC. I didn't stay there.


18

Very broadly there are two situations where you would apply this pattern: This is used internally to leverage some quality of the embedded language. This is used to provide external programmability. Internally Typically the embedded language is interpreted which allows changes to be made and tested quickly without a re-compile. The embedded language ...


16

What you need to write is called a language specification. It should contain a description of the language's grammar (preferably in Extended Backus-Naur-Form) and its semantics. For the latter part you could either write a description in your own words (but take care to be precise) or a formal semantics.


15

Since it's highly unlikely that another language will find broad adoption, your best bet would be to create a statically typed version of JavaScript (i.e. a language close to java) and a preprocessor that converts that to normal JavaScript. For example, your script looks like that: <script type="text/staticjavascript"> String foobar(int foo, ...


15

bash has been around since 1989, and its syntax is largely compatible with that of the much older Bourne shell, which was released in 1977. Huge swaths of core functionality in many operating systems (most Linux distros, OS X, and indeed most POSIX-compatible operating systems), and many real-world systems (make systems, automated tests, initialization ...


14

Let me attempt to find a dividing line between these three types of language. Of course, there will be numerous exceptions and counterexamples, since this is just my opinion. A markup language is used to control the presentation of data, like "represent these user names as a bullet list or as a table". A scripting language is used to mediate between ...


13

Generally the difference is that a "scripter" is writing scripts as part of some other process (IE, for batch processing, or for running backups), whereas a programmer is actually writing a complete application of some sort. The language is really irrelevant. The scripter is just writing "quick and dirty" scripts in order to get a job done, whereas a ...


13

Scripting languages are programming languages. The idea that the two types are separate ("versus") comes from people who are trapped in the mindset that a language cannot be both convenient and powerful. Mostly, these people have a C or C++ background, and they've worked hard to stay as close as possible to their language of origin (Java, C#). It's natural ...


13

A $ sign in variable name is a special case of "Sigil", Back in the early days of BASIC (1964 or so) $ was used to denote string variable names. My guess is, since it makes it easier on compilers to separate variable names from the rest of the grammar using some symbol, and since it was common to BASIC, its usage has progressed. However, this is not the ...


13

It's not just a bad idea. It's pretty much impossible. How do you implement IO with a language whose IO facilities depend entirely on the host operating system? How could you implement primitive scheduling without any useful interrupt primitives? How could you write a device driver in a language which cannot address a particular byte? Edit:-- Just to ...


13

A "script" is a set of instructions that do something the user could do themselves, only faster and with less possibility for error. Sure, I could delete all my old log files manually, but the script Bob wrote does it just fine. An "application" or "program", in contrast, is an automated or interactive bit of software that can be thought of as doing ...


12

Consts are good for just giving descriptive variable names to avoid the magic number problems, but they cause a similarly annoying problem of not being able to identify the value actually being used when the const is defined away from it's use. My suggestion, in all languages: define consts in as close a scope as possible to their actual usage. If used in ...


12

It depends on what code is in the include file. Did you try putting the #include for <stdio.h> inside main()? Depending on how the standard library is implemented on your system it may not even compile. Header files can contain not only function declarations, but function definitions. Standard C doesn't support nested functions. If your header file ...


11

You will need the following: A reason for creating a new language A Philosophy A Semantic Definition A lexical description of your tokens A Syntax Analysis definition How will your language be different? What is its mission? Is it functional? Is it object orientated? Is it a meta-language? What are its unique features? What will it give the world ...


11

Python. Period. Google has very good introductory lectures. EDIT Why? Because Python is: Easy to understand for beginners Scalable (can be used for developing small AND large project) Portable Cross-Platform Object-Oriented Simple FUN


11

Your teacher is correct, except that he assumes that his consequences are bad things. If you look at learning languages as purely an academic activity to learn how computers work, then he is correct. If you look at them as a way to get things done then you are correct.


11

The fact that you are dealing with a custom scripting language is irrelevant. You are migrating a set of scripts from one language to another. There are 2 basic strategies: 1) Take an on large effort to convert all the scripts upfront (as a project) 2) As you need to make changes to particular scripts, rewrite them in the new language. After some time, ...


11

C programmers, on the whole, will expect the #include directives to be at the beginning of the file. Why risk confusing them without any significant benefit?


10

"Programming language" is the general term for all programming languages. "Scripting language" describes how any language is used in some specific context. The main two areas which people usually refer to as "scripting" are: doing (mostly) simple file-system related tasks in the shell (i.e. shell scripting) running scripts in an interpreter/VM that is ...


10

Scripting and Programming is not how you classify languages. Scripting and Programming is how you classify what you are doing with the language. But in the end , these are loose and overlapping classifications.


10

Yes! You definitely can do that with Node.js or Rhino. For example the coffeescript compiler is nothing but a node.js script. I will admit that it is not generally my first choice for desktop scripting but I see no reason why it would not work quite well for a number of tasks.


10

Your understanding is correct, if you're from the past. You're pretty much describe as it looked like in 1990s. Yes, many languages can be executed directly by a web server plugin. Right on for PHP, mod_php for Apache is still the most popular way to host it. However, high-traffic sites use more modern approach, using web server only as a proxy for FastCGI ...



Only top voted, non community-wiki answers of a minimum length are eligible