Tag Info

New answers tagged

2

The part that is being repeated is this "square loop" pattern (read this from a to p): h i j k l g m f n e o d c b a p (Here I've shown a square loop of width 5.) The core of the solution lies in figuring out how to describe this pattern programmatically. This itself is composed of 4 strips that differ in the starting point and ...


0

The point is that the same Instruction Set can be used differently. And in practice, for efficiency purposes, that may matter a lot. An optimizing compiler can (and will, e.g. GCC with -O2 -mtune=native) produce different machine code for the same ISA, depending on the target processor. So the code optimized for an Intel processor is not the same as the ...


1

Note that Tanenbaum talks about what is exposed to low level programmers, not what happens at the level of CPU execution cycles. Down at that level are various micro operations that are involved in branch prediction, prefetch, pipelining, etc. Machine code instructions get broken down into smaller chunks after the point where programmers have direct access. ...


4

It looks like you borrowed some vocabulary from theoretical computer science (regarding the words "set" and "language"), and tried to use that to interpret the textbook description of the lower level computer systems (CPU and hardware). The word "set" as in "instruction set architecture" refers to the set of predefined opcodes that are valid for the given ...


2

Is there still any functional programming language that doesn't rely on C runtime? The answer to this exact question is yes: C is not the only low-level language which is suitable as a compilation target (although definitely the most popular one). For example, the Embedded ML described in Functional Programming for Embedded Flight Software ...


1

In principle? Yes. C is a programming language like all others. What C can do, other languages can be made to do. In practice? Rarely. C is near-ubiquitous as a systems programming language (there are exceptions, but they will be provided in the outraged comments, so I don't bother listing them), and it is almost always a better idea to use what is already ...


-2

You could/should read up on the following topics for preparation: finite state machines formal and context-free grammar parse tree Extended Backus–Naur Form For a start you could examine the scheme language. It is pretty easy to parse and analyse. You could develop something similar.


0

At the time Sun started to develop Java, the reason for them doing so felt obvious to me. We were living in a world, it seemed, where just about all personal computers on the planet ran Windows. And there was Sun Microsystems making these Unix workstations. And they had a very heavy push to get a better share of the personal computer market by making ...


6

While some of the existing answers address how Oracle makes money directly from Java, there is another effect, known in economics as a complementary good. By reducing the price of software (the complementary good), Oracle can raise the demand for their hardware that runs the software (and also for their DBMS software). You will often see software ...


3

There are a number of errors of how open-source foundations, and foundations in general work, in your question. I can see why a foundation would update a free programming language- in order to make the world of programming more accessible and effective. In the beginning modern programming languages, like Python or Ruby, may have been designed as ...


10

The only Java platforms that Oracle gives away for free (both gratis and libre), are the desktop and server ones. (And that is only a recent development, not too long ago, Oracle JRockit was proprietary and commercial.) As others have already said, Oracle makes money on the desktop and server by selling hardware and operating systems underneath, and ...


0

Another reason why Oracle still develop new versions of Java is to drag users (companies and people) to use a new version and pay for support for old, legacy, versions. As you can see here http://www.oracle.com/us/technologies/java/standard-edition/support/overview/index.html companies can pay Oracle to answer their questions, offer bug-fixes for old ...


9

Java is not free. Anyone who sells devices (e.g.: phones, Blu-ray players, TVs) based on Java ME or distributes customized Java runtimes (e.g.: IBM, Apple) is paying Oracle royalties.


28

Please note Java is not just a language, it's a platform. That said, consider this: Oracle sells Java-related hardware (servers) Oracle sells Java-related courses and certification Oracle sells Java-related tech support services Often times hardware companies (Oracle is also a hardware company ever since buying Sun) gives you some software for free, like ...


2

By definition of declarative languages, they cannot be executed in their purely declarative form; see e.g. the An intelligent system can and must use declarative knowledge efficiently paper of J.Pitrat, or several entries of his blog e.g. "stop programming!", "CAIA, my colleague", "know thyself", etc... So a declarative system is transforming the ...


5

There's no universal answer for all languages; it just depends on what's been implemented for a particular language. Haskell, in particular, can be either compiled or interpreted. Some declarative languages may only have interpreters currently, but a compiler could be written in the future. Also, don't assume that just because a language implementation is ...


1

The fact you already have experience with languages and have been working in a server/admin environment makes your bridging over much easier than others, so I'll focus on answering the two questions as best as I can based off of my experience. 1: What are your thoughts on the best areas to move into. Given that I have plenty of experience on *nix ...


3

Use an existing one -= don't bother reinventing the wheel when there are better wheels available, that are cheaper for you to use. Lua seems to be the most common C/C++ embedded script interpreter. There are even youtube tutorials on embeddeding it into your C++ programs, or codeproject.


4

There are many easily embeddable interpreters, notably GNU guile (and other Scheme variants, e.g. libscheme), Lua, Tcl, and even Python, OCaml, Perl (e.g. with parrot), NekoVM ... Notice that if your software becomes popular enough, and if its (advanced) users are permitted to script it (i.e. if the scripting ability is documented and accessible or ...


0

The C preprocessor is not Turing-complete (by design), yet it can still implement an interpreter for a language that is Turing complete (Order-the-language, as described in the documentation, is basically just a run-of-the-mill purely functional ML/Scheme type thing, and would be relatively unremarkable - probably quite nice to use - if it weren't for the ...


0

When you face a problem you usually think how to solve it. But if you know how computer solves it for you! Then you're concern about how will be eliminated. I try to say how it happens. You may already are familiar with recursive programs, in recursive programs, you define the problem rather to say how it is solved. you define the base, and define n ...


10

You seem to think that programming languages differ only in their syntax. This is not the case. Languages can have vastly incompatible semantics as well. For example: A functional language that uses lazy evaluation and an imperative language that allows side effects are difficult to combine. A language that allows pointer arithmetic and a language that ...


0

The previous answer works ONLY IF the key are a built-in type. To complement the previous answer, here is a way to implement a set whose elements are user-defined types: package math // types type IntPoint struct { X, Y int } // set implementation for small number of items type IntPointSet struct { slice []IntPoint } // functions func (p1 ...


0

There's certainly a case to be made for it. All high-level languages that aren't purely interpreted "compile to another language", and most developers manage to be successful without ever learning (or learning very much of) ASM/CIL/JVM bytecode/whatever else. However, it's important to keep in mind the law of leaky abstractions. When you work on something ...


3

Let me cite from your own question: "… more JavaScript, but I can't find the time or passion …" "I would definitely happily learn fay-lang or purescript …" It seems obvious to me what is the more likely course of action. You obviously don't enjoy JavaScript as much as the other languages you mention. Having fun while learning and feeling ...


0

computer program is a sequence of instructions, written to perform a specified task with a computer (by Wikipedia) It has nothing to do with programming language. it's just the definition of program. What is programming language? A programming language is a language (like English language, Persian, Arabic, etc), it has syntax and semantic (syntax: valid ...


1

My question is why do these articles and conversations always discuss pass-by-value, pass-by-reference, etc. solely in the context of parameter passing and function calls and not in the context of assignments? As Doval mentions in the comments, the primary reason is that assignment is often modeled as a function call (and can thus be ignored). why ...


1

Please, use the standard conventions for each language (or somewhat very close to the standard). More consistency in each piece of software itself (because it will have the conventions that really apply) More ease for additional (external) fellow developers. They must not learn "inconsistent" styles. Easier comparison/review/transfer of code out of / into ...


4

Coding standards should be specific to the particulars of each language and platform. An idiom that is considered essential in C++ might be superfluous for another language such as C#. For example, you might insist of always placing a constant in an 'if' expression on the left (5 = x) to reduce the chances of accidentally having a single equals accepted as ...


-1

Exception handling in most languages utilizes dynamic scoping; when an exception occurs control will be transferred back to the closest handler on the (dynamic) activation stack.


0

Is it possible to implement, for example, locking with unique types? I followed the link that Robert Harvey provided and I did a quick read-up. I cannot say that I understood everything or that I have a high level of confidence that I really understood what I think I understood, but it appears to me that the whole point of external uniqueness and ...


1

Something and everything that needs to represent itself as cross-platform will need some sources to sustain itself that aren't available in each environment. You're best with providing own sources (libraries or runtime environment) with your application. For example , take a look at NW.js, which was previously known as "node-webkit" project, uses javascript ...


6

You could use some languages with compiled implementations available on all the 3 platforms, e.g. Ocaml or Common Lisp or Haskell or Scheme (or maybe Go, Rust, Opa, Haxe, ...) You could also use implementations which compiles to C or C++ code, in particular Bigloo, Hop, etc.... (At some point Mozart/Oz was doing so) BTW, notice that even C has some runtime ...


3

If it can run in a browser, then JavaScript is available, as well as languages that compile to JavaScript like Dart, CoffeeScript, ClojureScript, and TypeScript. These are your only good choices for running on mobile devices as well as desktops and Chromebooks. For compiled desktop apps, there's Go. At a less mature state, there's D, Rust, and Nim.


1

Why not just quote wikipedia? Nails it down in my opinion: A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs to control the behavior of a machine or to express algorithms. Wikipedia - Programming Language


2

Note that the latter definition only talks about the machine language of some computer, not about programming languages in a general sense. I suppose the machine language is a programming language, but when treating programming languages as sets of programs, we can reconcile that with the latter definition by rephrasing it like this: The machine language is ...


19

From the perspective of programming language theory I would say neither. A programming language is 3 things A set of rules for constructing programs: the grammar of the language. A set of rules for determining whether a particular program is a valid program without running it: the static semantics of the language* A set of rules for actually evaluating a ...


3

There's really two things to understand: prototypal inheritance has nothing to do with performance at all. The performance issues come from runtime changes to the inheritance structure. prototypal inheritance (and flexible object structures) are not so much inherently slower, as they are harder to optimize. To illustrate the first claim, Ruby would be a ...


-1

AFAIK, there's not much difference between the two. Consider that a C++ class is really a block of data with a special, hidden data structure at the beginning called a vtable. This vtable contains all the pointers to the methods contained within the class. Now you see its not much different from a javascript prototype - which is a bunch of pointers to ...


1

In C++, classes makes sense because of the limitations that comes with the C++ philosophy that everything takes a back seat to maximum possibility for performance. You have two false premises inherent in this statement. The first is that classes are a C++ thing. They aren't; the concept is as old as OOP itself, dating back to Simula, the first ...


0

Only if you program in Go (functions/variables starting with a capital letter are exposed globally where as functions/variables starting with a lower case letter are only accessible from within the package). There may be other languages that do similar things.


0

There are cases where it definitely does matter, and that is if you are on a framework that uses strict Convention over Configuration, meaning there is other code looking for a certain function named exactly as it would expect. But other than that, it's more of a courtesy to your fellow teammates, and generally the interpreter doesn't care, allowing things ...



Top 50 recent answers are included