Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [programming-languages]

Artificial languages for instructing computers to do steps of computation in order to complete tasks. They allow programmers to communicate with computers.

-1
votes
0answers
35 views

How many request we can make at a time using “request” middle ware in nodeJS application

I am running a cron job every 5 mins to get data from 3rd party API, It can be N number of request at a time from NodeJS application. Below are the details and code samples: 1> Running cron Job every ...
2
votes
3answers
324 views

From a language design perspective, is the reference type in C++ mis-designed

Besides the fact that all primitive types of C++ are copy assignable except the reference type, it also doesn't play well with containers or any other parts of the language where copy-assignable ...
-3
votes
2answers
150 views

Why was the caret used for exponentiation in BASIC?

As far as I have been able to find, the first language to use ^ for exponentiation was BASIC, in 1964. Earlier languages, such as Fortran, used other symbols such as ** for exponentiation (although in ...
0
votes
2answers
80 views

Understanding Context Free Grammar using a simple C code

I'm trying to understand the difference between terminal and non-terminal values in a real language. I wasn't able to find enough examples on real language CFGs on the internet, most examples are ...
0
votes
1answer
80 views

Why are new modern languages shifting to a variableName: VariableType syntax approach? [duplicate]

Modern languages like Rust, Kotlin, and TypeScript, define their syntax to declare variables as: myVariableName: VariableType As opposed to the C-like approach not so old languages like JavaScript, ...
-1
votes
1answer
154 views

Writing programs in an unsupported language

Is it possible to write a program in a language unsupported by an editor or IDE, save it, then run it in different IDE or editor that does support the language?
-2
votes
1answer
106 views

What is the minimum set of operations a language implementation must provide for it to be usable for all applications?

As a fun hobby project, I'm writing a simple bytecode VM and a compiler from a basic high-level language to the said bytecode. (Offtopic: the compiler is inspired by Jack Crenshaw's awesome tutorial -...
2
votes
1answer
107 views

How hard should I try to write idiomatic code in a polyglot environment?

I work on a small team (2 primaries with one or two other occasional contributors) on a project/product that spans a number of separate platforms. We do embedded firmware in straight C on Arm0 chips. ...
0
votes
1answer
134 views

Is JavaScript unique in the way it treats missing property access?

Javascript has the behavior where an error is not thrown on missing property access on objects, which is the cause of many pernicious bugs: console.log("iPhone".missingProperty) // undefined I'm ...
0
votes
2answers
213 views

What makes PHP a language and jQuery a library?

PHP is written in C, but is considered a language. What makes it different from something like jQuery which is considered to be a library of Javascript? Why is PHP not a library of C or jQuery a ...
3
votes
3answers
382 views

In functional programming, what it means “Order of evaluation does not matter” when function is pure?

In context of pure functions in FP, apart from several benefits mentioned like easy to reason about, testability it also says "order of evaluation does not matter" since output remains same for given ...
1
vote
0answers
70 views

What obstacles should I expect in building universal Abstract Syntax Tree's manipulation tool?

I am trying to build code generation and transformation tool and hence I need software for Abstract Syntax Tree manipulation for at least three languages (Coq, Haskell, Java). So far I have managed to ...
0
votes
1answer
170 views

Is there a programming language with objects and generics, but without inheritance?

The GO programming language has objects but no inheritance. It also has generics for the built-in types Array and Map. Is there a programming language with objects but no inheritance and with generics ...
1
vote
6answers
333 views

Is it okay to have a parent class that doesn't represent an entity and doesn't have an “Is-A” relationship with its child classes?

I want to have an array that can hold elements of many classes data types, and each of these classes have a method called printInfo(). The way I can do that is by having a parent class called ...
4
votes
5answers
514 views

What is the “killer feature” of OOP? [closed]

I don't have much experience working with OOP, so I'm trying to understand what is the feature (or features) that would give you a great motive not to write some program in a procedural language, but ...
2
votes
4answers
278 views

Is there an object-oriented language that doesn't allow you to have private member variables? [closed]

I know that JavaScript doesn't explicitly allow you to have a member variable of an object as private, but you can do that implicitly by using closures. But is there an object-oriented language that ...
1
vote
3answers
231 views

Programming Language Interoperation for Website

Say I have one website created with the LAMP stack and another with the MEAN stack. I want to create a program which estimates the entropy of a password so that I can add a password strength meter to ...
2
votes
1answer
190 views

I'm moving away from using global variables after 7 years, I need help figuring out the basics

Until recently I was a huge fan of global variables because they are simple and allow building solutions to problems quickly. At one point I had to make a slight change to my application: it needed ...
-1
votes
1answer
68 views

What kind of of tools/architecture would work well for a student team competing in a robot soccer competition?

The scenario is as follows. There is a PC running a complex piece of AI software wirelessly controlling a number of soccer robots. This software is written and maintained by a team of students that ...
9
votes
1answer
101 views

Name of technique for inferring type arguments of a type parameter?

Setup: Let's assume we have a type called Iterator which has a type parameter Element: interface Iterator<Element> {} Then we have an interface Iterable which has one method which will return ...
148
votes
7answers
23k views

Was the C programming language considered a low level language when it came out?

Currently C is considered a low level language, but back in the 70's was it considered low level? Was the term even in use then? Many popular higher level languages didn't exist until the mid 80's ...
0
votes
1answer
150 views

How cross platform and different programming languages deployment is done?

I'm interested to know how software deployment for cross platforms as well as different programming languages happen. Like, Customers is on - linux and Windows Languages - Java, .Net, Ruby and ...
4
votes
2answers
422 views

Was Java the first programming language to support inner classes?

The Wikipedia article on the subject of inner classes enumerates a number of programming languages that support nested class definitions. Historically speaking, which programming language first added ...
0
votes
1answer
224 views

Do any programming languages let you use other languages without restriction within them?

This may be a stupid question, and it would certainly take one Hell of a lexer, but do any extant programming languages allow you to do something like: c# (1.2) { // c# code } Perl (5) { # ...
8
votes
2answers
510 views

Only one number type in language design

I am currently learning about compiler construction and language design and I am thinking about what native datatypes I want to support in my language. Now there is a whole lot of languages that make ...
4
votes
3answers
306 views

Using of different language in same project

I was started programming in 6 months ago in college. I learned Python, C and Java. I want to create a project and using these languages. For example to searching part should use C because it's faster ...
-1
votes
1answer
90 views

Do JITs typically have their own internal assembler, use a library, or use an executable assembler?

Amongst the successful and widely used JITs out there (e.g. JVM JITs, JavaScript JITs, LuaJIT), is there a strong consensus on how the JIT compiler should interface with an assembler? The plausible ...
111
votes
12answers
23k views

Why are multiple programming languages used in the development of one product or piece of software?

I am a recent grad student aiming to start my Master's in Computer Science. I have come across multiple open source projects that really intrigue me and encourage me to contribute to them (CloudStack, ...
1
vote
1answer
124 views

How do you actually utilize coding to produce projects? [closed]

I’m new to the whole programming society and the languages I’m learning right now are C++ and Lua. But as I’m learning it I can’t help but wonder how simple syntax such as print and if statements and ...
-4
votes
1answer
127 views

Assemblers Used During the Development of a Programming Language?

I am currently designing and developing a programming language from scratch. Mostly as a learning experience. Although it's not entirely related to the question, it's important that you know a little ...
4
votes
2answers
337 views

Should I duplicate code across languages?

Where I work, we use a language for our desktop software development (Delphi) and an other for web apps (asp.net/c#). My bosses want me to implement a feature on a website but they ask me to develop ...
0
votes
4answers
366 views

Why does C provide both the comma operator and the semicolon to separate statements?

Both the comma operator and the semicolon can be used to separate statements. Let's consider this simple code: #include <stdio.h> void do_something(int*i) {(*i)++;} int main() { int i; ...
11
votes
2answers
2k views

Is i,j = 1 really misleading? [closed]

There is a common argument about multiple variable initialisation in a one liner, that is : Consider for example int i, j = 1; which might lead some people to mistakingly believe both variables ...
0
votes
1answer
303 views

Grammar by example

Is there an automated approach to generate a grammar (which could be used later in a compiler tool such as ANTLR or similar) from given examples of a language? With more detail: assumed a technical ...
0
votes
0answers
74 views

Why is overloading called overloading? [duplicate]

I have problems with the term "method overloading". I know that overloading is the ability to create multiple methods of the same name with different implementations. My problem is however, that the ...
4
votes
2answers
438 views

Type-based memory safety without manual memory manage or runtime garbage collection? [closed]

Let's say we wanted a typeful, pure functional programming language, like Haskell or Idris, that is aimed at systems programming without garbage collection and has no runtime (or at least not more ...
3
votes
2answers
299 views

How to avoid generating verbose code when compiling from a higher level language to a lower one?

I apologize in advance for the vague title. I didn't want to make it overly verbose, so allow me to explain more in-depth below: I've currently been developing a strong, statically typed language ...
8
votes
4answers
678 views

Is having a generator language facility such as `yield` a good idea?

PHP, C#, Python and likely a few other languages have a yield keyword that is used to create generator functions. In PHP: http://php.net/manual/en/language.generators.syntax.php In Python: https://...
5
votes
2answers
159 views

How to support inheritance when designing an OO language without classes

I'm designing a programming language for a game, to be used as the main way of interacting with the game, as opposed to using other methods of control, such as the arrow keys or mouse. My plan is to ...
3
votes
1answer
113 views

Tool for validation of new code syntax in existing language

Does a programming language team have any tool to validate their new ideas about new code syntax? As an example, let's assume the Java language team starts developing new feature, which requires new ...
-1
votes
1answer
138 views

Why `wrapper` is better than 'adder'?

A bone-bare example of decorator is: def strong(func): def wrapper(): return '<strong>' + func() + '</strong>' return wrapper @strong def greet(): return 'Hello!' ...
2
votes
3answers
4k views

Why doesn't Java automatically initialize local variables with its default value like it does with arrays, class variables, etc.?

public class A { public static void main(String[] args) { boolean[] test = new boolean[1]; System.out.println(test[0]); } } prints false, as specified by the Java spec. ...
22
votes
6answers
4k views

Is it considered bad software engineering practice to always use “public” methods? [duplicate]

I've always used public methods and recently been advised by one of my friends to always avoid defining methods as public, as far as possible, though I have worked in any commercial company I have ...
-1
votes
1answer
200 views

TypeScript - Can “Structural typing” and “OOP paradigm” co-exist?

From Type Compatibility - Introduction: Structural typing is a way of relating types based solely on their members. This is in contrast with nominal typing. Consider the following code: ...
-3
votes
1answer
115 views

Multiple variable declaration, multiple variable assignment, context-sensitive 'in' statement

Lately I've been playing with writing my own programming language, following the excellent Crafting Interpreters book but I've hit something of a snag. I'd like to extend the parser to accept ...
0
votes
3answers
862 views

What is actually the difference between the GNU C Library and the C standard Library?

I sometimes see these two terms be used interchangeably. What is the actual difference between these two terms? How are they used differently? Are there any other alternatives to these two libraries?
0
votes
1answer
143 views

What is a good practice for connecting several parts of a project written in different programming languages? [closed]

Usually passing data inside a project isn't a big problem as long as everything is written in one language. However things may turn ugly, if parts of the program are written in different languages. ...
0
votes
4answers
3k views

If C++ is generally faster than java, why most data analysis / ETL tools are developed in java? [closed]

I've read in a lot of forums, a lot of users agree C++ is faster than Java (even if it leads for a microsecond, it is important), so why are the majority of data mining software or software tools ...
0
votes
0answers
63 views

solving variadic args for scripting engine

I'm developing a scripting engine (based on a stack VM) because of a few reasons. the scripting engine is meant to run C as a scripting language. (the github's wiki explains why) One feature I'd love ...
14
votes
1answer
1k views

Why does LLVM have an assembly-like IR rather than a tree-like IR? Or: why do projects target LLVM IR instead of clang's AST?

Why is LLVM's intermediate representation assembly-like rather than tree-like? Alternatively, why do language implementations target LLVM IR rather than clang's AST? I'm not trying to ask two ...