Having to do with issues arising when implementing a programming language.
Questions tagged [language-implementation]
141 questions
0
votes
0 answers
How does attribute assignment in R break down in terms of the language grammar?
Problem
In R, you can assign an attribute like so:
attr(x, "foo") <- "bar"
I get what this does, but I'm trying to understand how this statement breaks down into more fundamental pieces of the R language.
Thoughts
While attr is a function, it…

Chris Middleton
- 5,654
- 5
- 31
- 68
0
votes
1 answer
How is a Java object constructed?
If I create a class like:
public class Test{
int id;
String name;
}
Now, if I have to use the class, we have to just create a instance of the class as
Test testObj = new Test();
I would like to know how the actual object is created…

Anshul
- 635
- 2
- 11
- 27
0
votes
1 answer
Interpreted standard library
It's common for a programming language to come with a standard library implemented at least partly in the language itself.
In the case of an interpreted language, the obvious implementation is to read the library source files when the interpreter…

rwallace
- 31,405
- 40
- 123
- 242
0
votes
1 answer
When a user-defined type is called, what causes tp_new to reference object_new?
When a user-defined type is called to create a new object, type_call is called. Its first parameter is PyObject *type. Then, type->tp_new is called to create the object.
I'm reading Eli Bendersky's article (And following along CPyton's source code)…

OfirD
- 9,442
- 5
- 47
- 90
0
votes
0 answers
How to implement unquote-splice from lisp in JavaScript
I have basic lisp interpreter that I'm working on https://codepen.io/jcubic/pen/gvvzdp?editors=1010
and I'm having problem with unquote-splicing and lisp code like this:
(print `(,@(list 1 2 3)))
the output list structure of this code, from parser,…

jcubic
- 61,973
- 54
- 229
- 402
0
votes
2 answers
Weird syntax in golang math/big library
I'm using the math/big library in golang to perform operations on bit strings. Everything is working fine but I'm puzzled at why, for most of this library's functions, the syntax is:
var num1 big.Int
var num2 big.Int
var result big.Int
// Set num1…

Lucat
- 2,242
- 1
- 30
- 41
0
votes
1 answer
write-protected virtual pages, catch write
Does there exist a way to catch a write into write-protected page?
I plan doing a self -like object system where you copy the object to instantiate it. (because it sounds simple and compact thing compared to the rest) Obviously, the objects created…

Cheery
- 24,645
- 16
- 59
- 83
0
votes
1 answer
Dynamic linking with smalltalk objects
I plan about implementing a dynamic linking into my smalltalk dialect. The problem is about getting message passing to work with dynamic linking.
Message passing itself is as simple as this: message with a selector is sent to the object, the object…

Cheery
- 24,645
- 16
- 59
- 83
0
votes
1 answer
Javascript implementation question: how to make this function display values
Please forgive me, but I do know js basics and how to write/call a basic function, but in this case I'm trying to match an alpha sorted list of categories from the DB to match against my set (non-alpha) order of said categories as specified below…

Lynn
- 559
- 1
- 6
- 22
0
votes
1 answer
Java's TreeSet implementation of contains (Sourcecode) missing
When I open the sourcecode of the TreeSet Class there is the following code:
public boolean contains(Object o) {
return m.containsKey(o);
}
m is a NavigableMap which is an interface. So where is the implementation? It is definitely not in…

Gregor D
- 131
- 1
- 5
0
votes
3 answers
Osek Implementation language
In the OIL files, there's always a file called "Implementation.oil" that is included. I can't find anything that explain what this file do! Her is an example:
`
#include "implementation.oil"
CPU ATMEL_AT91SAM7S256
{
OS LEJOS_OSEK
{
…

Zohra-tl
- 53
- 9
0
votes
1 answer
Any languages whose functions cannot access global scope?
I've been writing a bit in a dialect of BASIC that has user-defined functions which can only access local variables; for example, the following code:
let S$ = "Hello, world!"
fn.def someFunction$()
print S$
fn.rtn "a string"
fn.end
X$ =…

JasonFruit
- 7,764
- 5
- 46
- 61
0
votes
1 answer
Is EOF guaranteed to be -1?
When writing code in C, is it good style to use -1 and EOF interchangeably? Does the standard guarantee that EOF is -1? Or is the value implementation defined?
For example, if a function returns EOF in certain cases, is it good style to test if the…

David
- 363
- 1
- 4
- 19
0
votes
2 answers
Pattern matching language knowledge, pattern matching approach
I am trying to implement a pattern matching "syntax" and language.
I know of regular expressions but these aren't enough for my scopes.
I have individuated some "mathematical" operators.
In the examples that follow I will suppose that the subject of…

George Kourtis
- 2,381
- 3
- 18
- 28
0
votes
1 answer
How does System.String save its string
To become better at .NET I found it helpful to look into the .Net-Framework itself and how Microsoft implements all the nice things. The last time I used my decompiler to have a look at the implementation of System.String-Class, to research how a…

Micha
- 5,117
- 8
- 34
- 47