Basthon Kernel issueshttps://framagit.org/basthon/basthon-kernel/-/issues2024-02-19T11:16:40Zhttps://framagit.org/basthon/basthon-kernel/-/issues/24Pyxel crashes Pyodide2024-02-19T11:16:40ZMaître RenardPyxel crashes PyodideCalling pyxel.init() causes the following errors:
- Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
- TypeError: Cannot read properties of null (reading 'addEventListener')
- Pyodide has suffered a fatal e...Calling pyxel.init() causes the following errors:
- Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
- TypeError: Cannot read properties of null (reading 'addEventListener')
- Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.
After closing the errors, you can no longer execute python code (I wanted to create Terrario Lite in Basthon).https://framagit.org/basthon/basthon-kernel/-/issues/23Structure API requests2024-01-28T18:06:44ZAristide GrangeStructure API requestsDans l'implantation de l'API `requests`, l'exception `ConnectionError` semble à la racine du module:
https://framagit.org/basthon/basthon-kernel/-/blob/master/packages/kernel-python3/src/modules/requests/requests/__init__.py?ref_type=he...Dans l'implantation de l'API `requests`, l'exception `ConnectionError` semble à la racine du module:
https://framagit.org/basthon/basthon-kernel/-/blob/master/packages/kernel-python3/src/modules/requests/requests/__init__.py?ref_type=heads#L23
Cependant, dans la version officielle de `requests`, elle se trouve dans le sous-module `exceptions`. Les utilisateurs de Basthon peuvent bien sûr faire une importation conditionnelle :
```
try:
from requests.exceptions import ConnectionError
except ImportError:
from requests import ConnectionError # patch for Basthon's partial implementation
```
... mais peut-être serait-il possible de modifier ça au niveau de Basthon même ?https://framagit.org/basthon/basthon-kernel/-/issues/22Demande d'évolution : Affichage en temps réel2023-11-06T18:40:40ZFrédéric PIOUDemande d'évolution : Affichage en temps réelBonjour,
Je souhaite proposer une amélioration pour l'interpréteur en ligne que vous maintenez.
### Problème actuel
Actuellement, l'interpréteur compile et exécute le script Python en entier avant d'afficher par exmeple toutes les sort...Bonjour,
Je souhaite proposer une amélioration pour l'interpréteur en ligne que vous maintenez.
### Problème actuel
Actuellement, l'interpréteur compile et exécute le script Python en entier avant d'afficher par exmeple toutes les sorties `print` dans la console une fois l'exécution terminée. Cela peut être problématique pour les scripts qui dépendent d'une sortie continue pour surveiller le progrès ou le débogage, comme dans les boucles infinies ou les processus de longue durée.
### Comportement souhaité
Il serait très utile que l'interpréteur puisse afficher les sorties `print` au fur et à mesure de l'exécution du script, plutôt qu'à la fin. Cela permettrait une meilleure interaction et surveillance du script pendant son exécution.
### Exemple de script concerné
```python
n=0
while True:
print(n)
n=n+1
```
Dans l'exemple ci-dessus, l'utilisateur s'attendrait à voir chaque nombre s'afficher successivement, mais avec le comportement actuel, rien ne s'affiche tant que le processus n'est pas terminé (ce qui, dans ce cas, ne se produit jamais).
Je pense que cette amélioration pourrait bénéficier à de nombreux utilisateurs qui ont besoin d'un retour en temps réel de leurs scripts.
Je vous remercie pour votre considération et suis disponible pour discuter plus en détail de cette proposition si nécessaire.https://framagit.org/basthon/basthon-kernel/-/issues/20new input scheme should be optional2023-04-06T11:51:00ZLaurent COOPERnew input scheme should be optionalIf basthon kernel is to be used outside of basthon site, the new input scheme should be switched off by a global option.
I use the kernel on my own site, and don't have the terminal to have the input to be asked
would it be possible to...If basthon kernel is to be used outside of basthon site, the new input scheme should be switched off by a global option.
I use the kernel on my own site, and don't have the terminal to have the input to be asked
would it be possible to add a global option to disable the new input scheme ?https://framagit.org/basthon/basthon-kernel/-/issues/17Add new functionalities to a kernel2022-04-27T12:51:51ZQuentin FortierAdd new functionalities to a kernelHello,
I would like to add new functionalities to the OCaml kernel: for example, display images or draw graphs/trees.
Is it already existing? Any hint on how to do this? How to start? Any example I could use to start with?
Bests regardsHello,
I would like to add new functionalities to the OCaml kernel: for example, display images or draw graphs/trees.
Is it already existing? Any hint on how to do this? How to start? Any example I could use to start with?
Bests regardshttps://framagit.org/basthon/basthon-kernel/-/issues/15Document Kernel API2021-12-30T15:35:23ZLaurent COOPERDocument Kernel APII can't find any kernel API documentation. Documenting the kernel API (maybe in the wiki of the project) could be a great addition for people using the kernel but not the console or the notebookI can't find any kernel API documentation. Documenting the kernel API (maybe in the wiki of the project) could be a great addition for people using the kernel but not the console or the notebookhttps://framagit.org/basthon/basthon-kernel/-/issues/12Think about offering an offline version and/or multi-platform desktop and mob...2022-11-06T21:29:20ZLilian BessonThink about offering an offline version and/or multi-platform desktop and mobile apps?As the Basthon infrastructure is apparently very easy to download and use locally from your own laptop, and requires no internet access, I think it would be awesome to offer an easy way to install and/or download the "app" on both multi-...As the Basthon infrastructure is apparently very easy to download and use locally from your own laptop, and requires no internet access, I think it would be awesome to offer an easy way to install and/or download the "app" on both multi-platform desktop (GNU/Linux, Windows, Mac) and mobile.
I've [opened a discussion](https://github.com/jbdo99/BetterOCaml/issues/6) with the developers of [BetterOCaml](https://betterocaml.ml/) regarding this topic. We are currently exploring different solutions.
I think in a week or so I'll have a clear perspective on what are the best approaches, and more importantly, the ones that don't require any application-specific coding!
What do you think about these ideas? Are you interested in helping?
Just to be more specific: without having specific code on the application side, even if it is purely client-side, if someone cleans their browser cache, or uses a smartphone, it's not possible to just open again <https://notebook.basthon.fr/> after having already visited it, and expect the app to work.
Also, offering some support for "installation" as a "native" app (desktop or mobile) means that it is integrated in the system of the user, launch-able with one click, and will definitely bring more visibility to this project.
I'm *not* thinking of writing an Android or iOS app, but to declare the websites as "progressive web apps", that can be installed on (recent enough) mobile phones as "native" apps.https://framagit.org/basthon/basthon-kernel/-/issues/11How hard would it be to develop a similar kernel that can use *any* Javascrip...2021-12-23T22:53:40ZLilian BessonHow hard would it be to develop a similar kernel that can use *any* Javascript interpreter backend?I'm asking because I would love to have a generic kernel that can work with any javascript library under the hood, as soon as the library is emulating a REPL!
I'm thinking about four possible uses:
- have a javascript mode, using a safe...I'm asking because I would love to have a generic kernel that can work with any javascript library under the hood, as soon as the library is emulating a REPL!
I'm thinking about four possible uses:
- have a javascript mode, using a safe `eval(input)` function,
- have a SQL(lite) mode, using <https://sql.js.org/#/>
- have a basic C/C++ mode ! See <https://github.com/felixhao28/JSCPP/>
- have a basic OCaml mode ! See <https://github.com/ocsigen/js_of_ocaml> and <https://github.com/jbdo99/BetterOCaml/>
Adding just one kernel that could pipe the input text to a REPL in (client side) javascript and print the response, would directly imply that we could (probably) easily add a lot of new usages to Basthon!
I'm hoping for https://ocaml.basthon.fr/, https://sqlite.basthon.fr/, https://javascript.basthon.fr/, https://ocaml-notebook.basthon.fr/, https://c-notebook.basthon.fr/ etc etc.
It would be awesome to lots of students in France (and elsewhere!).https://framagit.org/basthon/basthon-kernel/-/issues/10What should be developed here to add support for (some?) of the awesome IPyth...2023-10-20T21:00:06ZLilian BessonWhat should be developed here to add support for (some?) of the awesome IPython magic commands?I'm curious to know what should be developed here to add support for (some?) of the awesome IPython magic commands?
Reference: https://ipython.readthedocs.io/en/stable/interactive/magics.html
I know that a lot of teachers use very often...I'm curious to know what should be developed here to add support for (some?) of the awesome IPython magic commands?
Reference: https://ipython.readthedocs.io/en/stable/interactive/magics.html
I know that a lot of teachers use very often the wonderful magic
%timeit stuff to quickly time benchmark
and others... (I'll offer a list below).
I know that some like %%cython won't be usable, as [Cython](https://cython.org/) uses C extensions and GCC and obviously would be a nightmare to port to javascript (but... not impossible, using [C interpreter in javascript](https://github.com/felixhao28/JSCPP/), but useless if it's not native C which is blazing fast).
But some other magics are probably just basic Python code, and I'm thinking about this %timeit (which just uses the timeit module under the hood) as the good first candidate to try to add to Basthon-kernel.
[Here is the source code of %timeit](https://github.com/ipython/ipython/blob/219dea4d41ad70abc932ef71badd856eac103b70/IPython/core/magics/execution.py#L998) as of today.
It's quite long, and all this probably depends a lot on IPython internals... when looking at the number of "from IPython... import", it's scary.
But I would like to at least think about it, and try if possible.https://framagit.org/basthon/basthon-kernel/-/issues/7Error when stopping p5 script with the clean button2021-02-14T22:12:27ZLaurent COOPERError when stopping p5 script with the clean buttonWhen you try to stop a script in basthon with the clean button and it is running a p5 script in graphics windows, an error is thrown, because the function draw seems to be still executed while the background function does not exist anymo...When you try to stop a script in basthon with the clean button and it is running a p5 script in graphics windows, an error is thrown, because the function draw seems to be still executed while the background function does not exist anymore. Strange.
Trace of console with the p5 wave exemple on basthon.fr
```shell
Uncaught Error: Traceback (most recent call last):
File "/lib/python3.8/site-packages/p5/_global.py", line 174, in res
f(*args, **kwargs)
File "<input>", line 14, in draw
NameError: name 'background' is not defined
```https://framagit.org/basthon/basthon-kernel/-/issues/2Event handlers in p5js aren't being executed2023-09-10T16:14:41ZGottfried HaiderEvent handlers in p5js aren't being executedp5.js has event handlers, such as [mousePressed()](https://p5js.org/reference/#/p5/mousePressed) as alternative to predefined variables, such as `mouseIsPressed`. Basthon Kernel does not seem to call those currently (tested with [Basthon...p5.js has event handlers, such as [mousePressed()](https://p5js.org/reference/#/p5/mousePressed) as alternative to predefined variables, such as `mouseIsPressed`. Basthon Kernel does not seem to call those currently (tested with [Basthon Console](https://console.basthon.fr/) on 30.12.2020).
Here is a testcase:
```
from p5 import *
def setup():
createCanvas(400, 400)
def draw():
background(0, 0, 255)
if (mouseIsPressed):
print('mouseIsPressed')
def mousePressed():
print('mousePressed event') # does not work
run()
```
Thank you very much for your nice project. Bonne année 2021!