Giter Club home page Giter Club logo

iforth's Introduction

๐Ÿ‘‹ Hello Everyone! I'm Sohang Chopra

Top Langs

๐Ÿ’ผ Work Experience

I am a Software Engineer at MFilterIt, where I build data science & machine learning backend APIs using Python and AWS.

โœ๏ธ My Blog

During my free time, I read many books (technical and otherwise). Recently I started writing my blog by reviewing the book Blood, Sweat, and Pixels about video game development - check it here.

I have contributed to several Open Source projects, some of which are:

Note: All my projects' statuses are noted here.

๐ŸŒฑ Learning

  • I'm learning Rust and recently completed solving Rustlings exercises.
  • I am also learning Clojure using Exercism.io exercises.

๐Ÿ“ซ Contact Information

โšก Fun Facts

  • Code Golf using APL is too much fun - try it!
  • I love to read a diverse range of genres, both fiction & non-fiction.
  • My favourite sport is chess - I'm always ready for a chess match! ๐Ÿ™‚

iforth's People

Contributors

sohang3112 avatar

Watchers

 avatar

iforth's Issues

Add Magic Functions

Support standard IPython magic functions like %cd, %pwd, %env. Also, additional magic functions like %forth_version, %display_html can be used.

Create Docker package

  • Added Dockerfile
  • Make Dockerfile work with pip install in development verison (currently, only testing version builds, for which git clone has to be done before building forth_kernel)
  • Publish Docker image

Kernel hangs if invalid shell command is entered

For example, if an invalid shell command !lsd is entered in a cell, kernel hangs due to uncaught error:

Traceback (most recent call last):
  File "/home/sohang/.local/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 412, in dispatch_shell
    await result
  File "/home/sohang/.local/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 731, in execute_request
    reply_content = self.do_execute(
  File "/mnt/d/iforth/forth_kernel/forth_kernel.py", line 113, in do_execute
    self.answer_text(check_output(code[1:], encoding='utf-8'), 'stdout')
  File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'lsd'

If an error occurs on any line, remaining code should not be executed.

Jupyter Notebook Screenshot

In this example screenshot, when running this code:

clear .
1 2 + .

GForth raises a Stack Underflow error on first line clear ., but the second line 1 2 + . is still run. This should not happen.

  • if an error occurs on a line, stop execution
  • ensure catch word (which handles errors in Forth) still works

Block Comments (Ctrl+/) not working

Jupyter Notebooks usually allow block comments using Ctrl+/. But this is not working in Forth cells (while using the Forth kernel).
Block Comments should work by prepending with line comment character \.

This probably requires a change in the Jupyter frontend, which can be done by making a Jupyter Lab/Notebook extension.

Allow other Forth implementations to be used

Currently, GForth is used to evaluate all code input from Jupyter Notebook. Other Forth implementations, such as PForth, could also be allowed (maybe using an environment variable?).

PForth has the advantage that it can be built and run on Windows also.

Trim Code Output

Currently, in Jupyter cell output, things like the code input, GForth remarks like ok and compiled are shown. These things shouldn't be shown - only actual program output should be shown.

Long output lines don't show

This is because kernel waits for GForth output and shows it all at once after it's done. This won't work for long-running output.
In the extreme case, the output may never show in case of an infinite loop.

To fix this, show cell output as soon as it's available instead of waiting for output and showing it all at once.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.