Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

系统。扫描() reads at most 98 characters #17

Open
ekzhang opened this issue Dec 21, 2023 · 0 comments
Open

系统。扫描() reads at most 98 characters #17

ekzhang opened this issue Dec 21, 2023 · 0 comments

Comments

@ekzhang
Copy link

ekzhang commented Dec 21, 2023

Hello! This is a really cool language concept & fun to use. I noticed when writing some code in this that the 系统。扫描() function seems to have some strange behavior with long lines.

If you read a line more than 98 characters wide, 系统。扫描() will return only the first 98 bytes. If you then call 系统。扫描() again, it will return the next 98 characters, but it will skip one character.

So:

[---first 98 bytes---][1 byte][---next 98 bytes--]\n
 ^ first 系统。扫描()          ^ second 系统。扫描()

It looks like this is just because the 系统。扫描() function has a static array on the stack.

Let me know if you'd like me to write a quick patch for that to allocate the array dynamically! Besides that the language seems to be really solid. I wrote a binary heap and Dijkstra's algorithm, and the performance is good.

(I also noticed that the language will hang indefinitely if 扫描 gets an EOF.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant