Comments (5)
Yes, you should be able to recover the stack trace for the implementation of recover
. The current goal for libstd is to keep it small, and allow libs to be easily imported from the web... So one would do import json 'https://libs.com/json.cy'
. But we could also keep an official set of modules in this repo. They would just be library modules that expose the interface with bindLib
. There are a couple of things that needs to be done first though... one is user modules which I'm working on now. @matu3ba
from cyber.
Awesome! Thank you.
from cyber.
Hello @zachcp, I just fixed coreReadLine
in 0c59964 to return a error(#EndOfStream) value when EOF is encountered. recover
hasn't been implemented yet as the design hasn't been finalized. This issue can remain open as reminder to complete recover
. I also wouldn't recommend using try
right now outside of writing tests. Here's how you might handle the error:
for:
line = readLine()
if line == error(#EndOfStream):
print 'end of stream'
break
else:
print line`
from cyber.
Will this also work for use cases like this:
def runTest(da: dalib.Talib) -> int:
st = da.expectEq(list(ta.storage_msg[0].keys())[0], "1")
# This line feels very superfluous, but I need stack trace (without crashing) + dump program state
if st != 0: da.failTestDumpState(st); return 1
st = ta.expectEq(list(ta.storage_msg[0].keys())[1], "2")
if st != 0: da.failTestDumpState(st); return 1 # again feeling superfluous (2x time code size)
# ...
def failTestDumpState(self: object, status: int):
print("FAIL with status:", status)
traceback.print_stack() # printStackTrace
self.dumpState()
print("last_setEvState:", self.timeline_msg[self.dump_timeline_msg_last])
print("Messages still in Queue:")
while self.queue_msg.empty() == False:
msg= self.queue_msg.get(block=False)
writeQueueMsg(msg)
da = dalib.Dalib()
da.init()
st = runTest(da)
sys.exit(st)
?
If @fubark provides sufficient pointers on how libstd works, then I can start with libstd xml and json/dictionary functionality I dearly miss in python or is super clunky. This should also provide better insights into performance of realistic applications.
from cyber.
recover
is no longer part of the language since Cyber has moved to a try/catch mechanism. Please open a new issue if anyone has trouble using it. Learn more about error handling here: https://fubark.github.io/cyber/docs/toc/errors/
from cyber.
Related Issues (20)
- Jupyter Kernel HOT 3
- Is it possible to Implement a Cyber repl HOT 3
- Null Safety / Null Coalescing plans? HOT 1
- RFC: Replace CYON with JSON5 HOT 1
- README links are broken HOT 1
- Independent Benchmarks HOT 1
- Embeddable static library undefined symbols HOT 6
- Error occurs when compiling the examples - undefined symbol: execBytecode. HOT 4
- Implement Fiber.reset HOT 1
- Unstable zig package for tooling HOT 12
- Revising data literal syntax. HOT 1
- Hot Reloading? HOT 1
- Printer functions seem to duplicate output prefix HOT 3
- CLI / wasm HOT 2
- Add multi -thread support HOT 1
- findAnyRune return unexpected index HOT 2
- Document description is inconsistent with interface specification HOT 1
- android build support HOT 6
- "TODO" error when defining out-of-body $call for type trait HOT 2
- Feature request: expose a zig module HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cyber.