Hello all! I have a question about Mojo REPL output
I’m trying to improve the Answer.ai mojokernel created by Answer.ai for Jupyter Notebook (GitHub - AnswerDotAI/mojokernel: A Jupyter kernel for Mojo · GitHub), so
it works better on Linux. The current version doesn’t have var persistence on Linux.
Right now, I use REPL::IOHandlerInputComplete from LLDB’s REPL (llvm-project/lldb/source/Expression/REPL.cpp at main · llvm/llvm-project · GitHub). But it doesn’t return an
execution status, so anything in stderr will be treated as an error.
I’m thinking this could be problematic in cases where Mojo runs some code successfully but
outputs a warning. In this case, mojokernel would treat it as an error.
But when I try some code in the official mojo repl, it doesn’t output the warning either.
Example below:
@deprecated(“testing warning”)
def old_fn():
print(“test”)
old_fn()
REPL output:
1> @deprecated(“testing warning”)
2. def old_fn():
3. print(“test”)
4.
4>
5> old_fn()
6.
test
It does output a warning if I use a normal script instead of the REPL.
So I guess maybe I don’t need to worry here, because mojo repl also doesn’t output warnings? Or
maybe I missed something?
If it does output warnings in some cases, maybe I need to create a patch for
REPL::IOHandlerInputComplete to expose a proper execution status, or should I do something else?
Thank you!