-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
Currently bitstring segment size must be multiple of 8 when compiling to JavaScript, add compiletime check #1591
Comments
I don't agree. Being able to manipulate bitstrings at the bit level is actually pretty useful. After doing it in elixir and gleam, I really miss it in javascript and Rust. |
This issue isn't saying don't implement bitstrings down to the bit level. it's saying while only bytes strings are supported (as is currently the case) For that time we should warn at compile time, rather than runtime when possible. If there are suggestions in how to support bit level manipulation in JS it would be good to explore them. |
…on js Try to detect when someone tries to make a non byte aligned array on Javascript. This compile time error still fails to trigger if the size value is a variable though. So we still need the runtime error in the Javascript template too. Fixes gleam-lang#1591
…on js Try to detect when someone tries to make a non byte aligned array on Javascript. This compile time error still fails to trigger if the size value is a variable though. So we still need the runtime error in the Javascript template too. Fixes gleam-lang#1591
…on js Try to detect when someone tries to make a non byte aligned array on Javascript. This compile time error still fails to trigger if the size value is a variable though. So we still need the runtime error in the Javascript template too. Fixes gleam-lang#1591
…on js Try to detect when someone tries to make a non byte aligned array on Javascript. This compile time error still fails to trigger if the size value is a variable though. So we still need the runtime error in the Javascript template too. Fixes gleam-lang#1591
This won't catch all errors, because x could evaluate at runtime to a value that isn't a multiple of 8. However catching the literal cases when the term is explicitly an integer will still be valuable.
The text was updated successfully, but these errors were encountered: