4,052 questions
0
votes
0
answers
43
views
How to build a gcc_tree_node from custom language Nodes
Nodes:
building a gcc_tree_node for a custom prograimming language
compile and base on C++26
the modules are avilable
the language using tab-block system
every keyword start with '/'
I want to ...
2
votes
1
answer
22
views
How do I add a table to a Nytril Document?
I have the Nytril IDE installed and need to add a pie table to my document. I have looked through the tutorial but I am having trouble getting the table to appear.
I tried this, but it doesn't work.
...
0
votes
1
answer
104
views
Does C11, C99 or C23 have a PEG specification?
Is there a PEG parser for C language?
Is there any list of programming languages with a PEG specification?
1
vote
1
answer
102
views
Dart multiple generic type evaluation
I saw an article about the Result pattern on the official flutter site(https://docs.flutter.dev/app-architecture/design-patterns/result), and I thought it was a good structure, so I tried to apply it ...
0
votes
1
answer
60
views
Python library pydub, exit code -1073741819
I am making a program where I need to play files many times. When I play a file, it plays, but after 2 seconds the program closes with exit code -1073741819.
Code: "
from pydub import ...
1
vote
1
answer
49
views
Segmentation fault encountered at `ret void` in llvm-ir instructions
I'm currently making a compiler that outputs bare LLVM-IR instructions and implementing variadic function calls. I have defined a println function that accepts a (format) string and variable amount of ...
0
votes
1
answer
66
views
If everything is an object in Python, how is the value of a primary type stored?
In Python, everything is an object. I'm fine with this. If I inspect a list or even a float, I can see there is a class associated with that data. But at the end of the day, if I make an value
x = 1, ...
-2
votes
2
answers
1k
views
Are there any Pine script alternatives now? [closed]
I've been using Pine Script on TradingView to develop custom trading indicators, but I'm looking to explore other options. I'm particularly interested in languages and platforms that might offer more ...
0
votes
1
answer
87
views
How much performance of current hardware is left out due to SW (higher-level programming languages)?
I was wondering how much potential performance of our current HW is unused due to higher level programming languages (here I consider C and C++ to be high level languages).
Of course I know that it ...
-3
votes
1
answer
100
views
Wrong results of using sizeof operator in C++ [closed]
I have a question regarding the sizeof() operator.
If you can see my code below in the pic:
When I used sizeof(command), it showed me that the number of bytes was equal to 28:
When I counted by ...
1
vote
1
answer
118
views
How can passing the `IO ()` to `main` be considered pure?
I don't quite understand how printing (outputting to the screen) can be considered pure in a programming languages sense, but I was claimed to that such a concept exists in Haskell.
You create an IO ()...
0
votes
1
answer
83
views
Prolog evaluation of unknown variables [duplicate]
Consider this:
list_length([], 0).
list_length([H|T], N) :- list_length(T, N - 1).
It doesn't give a compilation error, but it doesn't work.
my thinking is:
suppose i call list_length([1], N)
we ...
0
votes
1
answer
73
views
Bison ID reduction conflict
I'm working on a simple programming language, writing it from scratch, and using Flex and Bison.
This language recognizes simple arithmetic expressions and imperative variable statements.
I'm having a ...
0
votes
0
answers
28
views
How does a program store variables? [duplicate]
When I declare a variable in, let's say C:
int x;
The compiler allocates memory, and assigns a memory address to that variable.
When I reference the variable again, the compiler generates some ...
0
votes
2
answers
151
views
Java bytecode not in .class file
I'm working on a personal project just for fun, a new programming languages (just because there are not enough). I m going to make it run on JVM but I need to store some metadata in the compiled file. ...
0
votes
1
answer
129
views
How to implement mutual calling between different programming language by shared library?
Recently, I have been interested in how Apache can support Python WSGI. After researching, I found out that there is a mod_python module, which is a shared library written in C. Furthermore, I also ...
0
votes
0
answers
70
views
How to make Intellij highlight and collapse code (in your own language)?
I'm making my own programming language. But now I want Intellij to highlight my new language and also - and that is very important for me - to collapse code blocks. What I mean by that is the ...
1
vote
0
answers
109
views
Is this a reasonable way to construct the syntax node of an abstract syntax tree in C++ (or is there a safer or more memory-efficient construction)?
I am writing a (most likely bottom-up) parser for a new general-purpose programming language. My parser takes in a stream of tokens. For completeness, here is the token_t.
struct token_t {
// Kind ...
0
votes
1
answer
40
views
How is class property assigned in constructor call without being a parameter
I don't get behind the magic of these kind of calls, especially the second argument:
[DllImport("Kernel32.dll", CharSet = CharSet.Auto)]
The constructor of DllImport is called with two ...
1
vote
0
answers
130
views
Would an ECS-specific programming language be helpful?
I've thought about creating a programming language specifically for developing ECS, but I do not have enough experience to conclude whether or not it would be useful at all or not. Can anyone give me ...
1
vote
2
answers
94
views
How to handle Python exceptions in a decent way?
I am developing an online service with python. Since it is an ONLINE service, I do not want the service down under any circumstances. So I add lots of try.. except... to make sure that if anything bad ...
0
votes
1
answer
141
views
Antlr adding additional parameters to visit methods, accommodations for continuation passing style
I am trying to do continuation passing style for a simple programming language made with antlr. Typically you would have an eval procedure that takes as arguments the expression to be evaluated as ...
1
vote
2
answers
129
views
why is `(((call/cc (lambda (k) k)) (lambda (x) x)) "HEY!")` evaluated to "HEY!"?
I am reading The scheme programming language and seeing this example in continuation section:
(((call/cc (lambda (k) k)) (lambda (x) x)) "HEY!") => "HEY!"
I cannot figure out ...
1
vote
0
answers
88
views
Techniques and terminology for learning a massive code base
This question is not specific to one programming language in particular, and perhaps intended to help someone who isn't formally trained in programming.
I have always worked on my own and without any ...
1
vote
0
answers
76
views
How do JavaScript runtimes implement binding functions to objects? [duplicate]
I'm implementing a JavaScript interpreter, and I can't figure out the details of binding functions to objects in JavaScript.
A rudimentary example:
const o = {
x: 1,
getX: function() {
return ...