2,283 questions
1
vote
1
answer
95
views
The until function never exits
I am writing a lisp interpreter with rust. I already have a lot of functions, but the loop does not seem to work. The loop is until, which is the opposite of while. It loops until the value is t.
use ...
2
votes
5
answers
185
views
implement multiple dispatch (like in julia, numba, etc) in C
Preamble
So i've noticed that a lot of functional / jitted languages (eg julia, numba jit for python) have virtual methods attached to "functions" rather than classes, and those "...
0
votes
0
answers
59
views
Mismatch Between Quantized TFLite Layer Outputs and Expected Mathematical Values When Using get_tensor()
I am trying to extract intermediate outputs from a quantized TFLite model using the TFLite interpreter. The goal is to verify that the model's intermediate outputs match the mathematically expected ...
1
vote
1
answer
92
views
Multiple Python Paths
I have multiple Python Paths to choose from as seen in the images. I remember installing Python via brew and through the internet and Anaconda.
I don't have any idea which are redundant and what to ...
-6
votes
1
answer
58
views
import : The term 'import' is not recognized as the name of a cmdlet etc [closed]
im trying too import packagaes to my pycharm such as tensorflow and the same message pops up saying the term (import) is not recognized. My understanding is that pycharm is interpreting these commands ...
0
votes
1
answer
72
views
Is there a way to instrument python code like this to run my tracing function on it? [duplicate]
So for example if I have this python code
def adder(x,y):
return x + y
So I am tracing the values of variables for python source code and I want to run the sys.settrace using my trace function on ...
0
votes
0
answers
38
views
VS Code switching the interpreter from conda to base
I'm trying to learn to use conda the "right" way. In the past I was creating new virtual environments using the shift+command+p combination and picking the "create environment" (I'...
1
vote
0
answers
42
views
PyCharm associates the system interpreter with new folders opened as projects—how to disable this behavior?
For some time now, I’ve noticed that PyCharm automatically associates the system interpreter with every folder I open as a project for the first time. This isn’t the same as creating a new project—it’...
1
vote
1
answer
112
views
Is V8 Ignition "Interpreter" capable of producing byte code only because it was built on top of TurboFan Compiler?
The V8 Engine contains both Ignition "Interpreter" (which is an interesting name for something that not only interprets) and TurboFan Compiler. TurboFan compiler helps to optimize "hot&...
0
votes
2
answers
61
views
How to ensure that the Python file is correctly executed in a nested folder structure?
I am trying to run a Python file from a codebase, and have created a minimal example to explain the issue that I am facing.
foo
├── bar
│ ├── burp
│ │ └── cache.py
│ ├── __init__.py
│ └── ...
0
votes
1
answer
88
views
Differences between Trinket and online-python.com
I have this computer program that's supposed to draw a Hand of Mahjong Tiles from a deck:
# imports random
import itertools, random
# make a deck of tiles
deck = list(itertools.product(range(1, 5), ...
1
vote
0
answers
92
views
Fastest x86 64 jump table. What are the methods for making very performance oriented jump table?
I am in the process of optimizing a program that interprets some byte code, and depending on it jumps to different instructions. Since we have the instruction in byte code already ordered from 0-17, ...
0
votes
0
answers
77
views
Python code pauses execution randomly till I move the VS Code Terminal
I am running an code which performs inference for several hours. However when it seems to randomly pause.
But when I move the VS Code's terminal border/window slightly, it starts executing. I don't ...
-1
votes
2
answers
119
views
Why will a syntax error prevent Python from running preceding lines? [duplicate]
Why is the CPython interpreter not executing the previous statements if an EOL syntax error occurs in a later line? I thought that an interpreter is supposed to execute all the statements in a file ...
0
votes
0
answers
74
views
Python Scripts Don't Adopt Selected Environment in VSCode
When I select a virtual environment (created with mac default venv command) as my interpreter for a Python file in VS Code, it doesn't change the Python executable path and instead uses my base ...
0
votes
1
answer
798
views
Why does my pycharm terminal is failing to start
I've been having issues with the terminal in PyCharm recently it always gives me this error message:
Cannot open Local
Failed to start [powershell.exe, -NoExit, -ExecutionPolicy, Bypass, -File, C:\...
0
votes
1
answer
56
views
How can the expression rule be converted into LL(1) without becoming right-associative?
In the following small grammar, I am confused about how this basic rule for defining a binary operator combination can be converted to an LL(1) grammar that will produce a left-associative AST:
...
0
votes
1
answer
166
views
Go Types for BNF Grammar
I'm working on the crafting interpreters book and as a personal project I've decided to implement JLox on Go instead of Java mainly to learn Go.
Currently I'm stuck with the parser, I'm unsure how to ...
1
vote
1
answer
60
views
Python is not finding location of file to parse, even when i have triple-checked it is still there
I am making a interpreted language using python, named Spearhead. My terminal, when trying to run the command "+r {+r is how i run files} [path to file to be interpreted]" It gives me my ...
1
vote
1
answer
62
views
implementing a Tcl "atreturn" feature?
I'm using a Tcl-based framework for building packages (MacPorts) and would like to implement an atexit-like feature where I can print some information in case a build fails and the framework aborts.
A ...
0
votes
2
answers
83
views
subprocess.check_output not catching python errors [closed]
I am creating a Python programming language, named Spearhead. I have a working terminal, made via the Subprocess module. The issue is that I am using check_output to catch python errors, and not ...
0
votes
1
answer
63
views
can't find '__main__' module | breaking subprocess terminal command
I am creating a programming language named Spearhead using Python, I have a parser named Parser.py, inside a subfolder of the Spearhead folder this is all contained in named raw_exec [that has a empty ...
0
votes
0
answers
42
views
Problem with File Descriptor Handling in a C Command Line Interpreter Using Pipes
I'm building a simple command line interpreter in C, and I've encountered an issue with handling file descriptors when using pipes. The interpreter is supposed to support piped commands, but I'm ...
0
votes
0
answers
25
views
PyCharm: Configuring SSH interpreter - automation
I'd like to create a development environment using a python or a bash script.
I want to connect PyCharm to python interpreter in a docker container by running the script. Is that possible? What files ...
-1
votes
2
answers
82
views
Questions about python virtual environment in VScode
So a question I can't find a clear answer to is if my python interpreter that I have selected (where it shows 3.12.5('.venv':venv) is set that way because I selected to create a virtual environment.
...
-2
votes
1
answer
86
views
Why does the [ and ] instructions not work in this Brainfrick interpreter implementation?
The code below is a rough cut implementation of the brainfrick interpreter in Java. The specs I'm using are as follows:
Brainfuck commands
> Increment the pointer.
< Decrement the pointer.
...
-1
votes
2
answers
92
views
LimeTabular TypeError: __init__() missing 1 required positional argument: 'model'
I've started learning Lime. When I use LimeTabular form Interpret, I face a problem that I according to the standard complete the function but it doesn't work.
The error is TypeError: init() missing 1 ...
-2
votes
2
answers
390
views
VSCodium Fails to Detect Virtual Environment Interpreter
I activated the virtual environment of my project via the terminal and then opened the project path in VSCodium. However, VSCodium fails to find the interpreter of the virtual environment when I try ...
0
votes
1
answer
120
views
Unable to build interpreter for TFLITE ViT-based image classifiers on Dart / Flutter: Didn't find op for builtin opcode 'CONV_2D' version '6'
We are trying to deploy vision transformer models (EfficientViT_B0, MobileViT_V2_175, and RepViT_M11) on our flutter application using the tflite_flutter_plus and tflite_flutter_plus_helper ...
-1
votes
2
answers
1k
views
How do I get PyCharm 2024 to use the right Python version?
My company computer came pre-installed with Python version 3.13. Unfortunately, the standard we've been using for the past few years is version 3.7.0, which means a lot of our packages/venvs are ...
0
votes
0
answers
41
views
How to resolve python iterpreter-related "ModuleNotFoundError: No module named 'torch’” on a Mac
I have cleanly and successfully installed PyTorch and associated packages within my virtual environment (BotVirtualEnv). It passed all required tests, including that of Python Interpreter and ensured ...
0
votes
1
answer
104
views
How does this grammar get rid of infinite recursion in left-associated recursion?
"Suppose we have a grammar like this, where alpha could be any sequence of terminals and nonterminals:
A -> A alpha | B
We can rewrite this grammar as:
A -> B A'
A' -> alpha A' | ...
0
votes
1
answer
103
views
Python interpreter if statement issue
So, I am making a really simple Python interpreter. But, there is a part in the interpreter that checks for if statements. But, whenever I use this interpreted if statement, it checks every other ...
0
votes
1
answer
40
views
how using css variable with SASS rails interpreter? (conflict)
I'm using sass-rails gem and I try to use css variable like this :
--h: 198
--l: 38%
--c: hsl(var(--h), 100%, var(--l))
background-image: linear-gradient(to right, var(--c) 0%, #000 100%)
...
0
votes
1
answer
96
views
Is it necessary to convert each Intermediate Representation instruction individually to Assembly in an interpreter?
I am developing an interpreter that converts an Intermediate Representation (IR) into an Assembly. However, I have a doubt that it is necessary to convert each instruction individually to Assembly, as ...
1
vote
1
answer
107
views
Logging interactive queries in SWI-Prolog
I would like to intercept the queries handed to the interactive Prolog interpreter, in order to do some extra processing, e.g. to log the queries.
So far I have the following code that relies on the ...
0
votes
0
answers
119
views
How do I JIT-compile a function called through a pointer?
I am writing a JIT compiler for an extension of Brainfuck that has functions. Functions are referred through a function pointer that you can increment/decrement and call it.
My approach is that it ...
0
votes
1
answer
1k
views
Strange Output in VSCode with Python 3.12.3: Unusual Characters and File Paths
enter image description here
I'm encountering a peculiar issue while running Python code in Visual Studio Code (VSCode) with Python 3.12.3. When I execute a simple print("Hello") statement, ...
0
votes
1
answer
191
views
How do I set relative path as interpreter path xlwings custom add-in
I have made custom add-in using xlwings. I have one dictionary where is: phodnota.py, phodnota.xlam and Python311 (dictionary with python interpreter and all needed libraries). The problem is that ...
0
votes
0
answers
96
views
Adding a New Operator to CPython 3.9 Fails to Recognize Syntax in Python
I'm following the CPython internals guide from Chapter 7.5 on adding an operator. The guide uses the example of the "almost equal" operator (~=). Despite following the prescribed steps and ...
1
vote
1
answer
45
views
Resolve shift/reduction conflict in grammar for expressions in PLY for calls to embedded functions
I'm creating a grammar for an interpreter in PLY. At the moment I'm trying to implement embedded function calls as expressions, but I'm having a problem seeing where the conflict is for the following ...
0
votes
1
answer
100
views
How to use menhir to parse into a GADT expression?
I have just learned something about GADT in OCaml through Real World OCaml, and want to try to transfer the first little language there into a interpreter, thus using menhir.
The ast definition is ...
0
votes
1
answer
329
views
PyCharm cannot create Interpreter in Python3
I am a newbie in programming and have been learning only for a little while.
I am trying to get started using PyCharm but it does not manage to create an interpreter in Python3. When I try to create ...
-4
votes
2
answers
898
views
When using a jupyter notebook in VSCode, the Python interpreter is ignored
I have a virtual environment with some installed packages and a notebook with some imports of packages that only exist in this environment.
I have done Ctrl + Shift + P > Python: Select Interpreter,...
1
vote
1
answer
109
views
How do I write an implicit cast for my strongly typed interpreter? (C++)
I'm currently writing an interpreter and it's strongly typed. It has short, int, long, float, and double.
I want to make binary operation between 2 numbers and have an implicit cast.
For example, I ...
0
votes
0
answers
69
views
32bit and 64bit python interpreter in one project
In a project I have to use both 32bit and 64bit python interpreters, specifically 32bit for pyodbc library(required for older version of MS access DB) and 64bit for pandas, work could be done without ...
0
votes
1
answer
69
views
python subprocess calling the local interpreter instead of the linked one
I am attempting to execute a function within a Python script as a subprocess using its own interpreter, specified in the subprocess.run() call. This interpreter may include packages not present in my ...
0
votes
1
answer
81
views
PyCharm: ModuleNotFoundError although module (scipy) is installed
I am working with PyCharm and encountered a ModuleNotFoundError when I try running a script that was working about half a year ago. It says:
File "lalala/main.py", line 5, in <module>
...
1
vote
0
answers
68
views
Matlab: Selectable text in EPS-figures when using latex interpreter and/or importing fonts
I would like to save figure as EPS-files with a special font. I can do that with latex as interpreter, but that also means the text in the EPS figures are no longer selectable or searchable, which I ...
0
votes
1
answer
72
views
Handling Tuple Values in Word Attributions for Transformers Interpret
I am working on interpreting word attributions using the transformers_interpret library for a fine-tuned model in a natural language processing task. I want to print all the attribution scores and ...