Skip to content

Commit

Permalink
Wrap some readme lines
Browse files Browse the repository at this point in the history
  • Loading branch information
dusty-phillips committed Sep 14, 2024
1 parent eefcad8 commit 6feb561
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ gleam run -- some_package_folder

The package folder should have a structure similar to a normal Gleam project:

```
```plain
folder
├── gleam.toml
├── build
Expand Down Expand Up @@ -126,22 +126,27 @@ Some tasks below are marked easy if you want to get started.

- Functions as type fields are not supported yet
- e.g pub type Foo {Foo(x: () -> String)}
- debatable whether to make them a `def` right on the class or have the def be defined somewhere and just attach it like other fields
- debatable whether to make them a `def` right on the class or have the def
be defined somewhere and just attach it like other fields
- IN case statements, the following patterns are not supported:
- Concatenate patterns
- Bitstring patterns (bytes)
- The problem with both is python match has no way to match on "parts" of bytes or strings. Possible solutions:
- The problem with both is python match has no way to match on "parts" of
bytes or strings. Possible solutions:
- convert the entity to a python list and match on that
- construct a potentially massive match guard ('case ... if') to compare elements.
- construct a potentially massive match guard ('case ... if') to compare
elements.
- Destructuring in assignments is not supported yet
- (EASY) tuple destructuring can map straight to python destructuring
- other structures will maybe need a match statement?
- type aliases aren't supported yet (module.type_aliases)
- (EASY) internal/errors.format_token needs help
- glance doesn't have (much of) a typechecker
- Might be able to extract one from [gig](https://github.com/schurhammer/gig)
- This work is expected to happen in [glimpse](https://github.com/dusty-phillips/glimpse?tab=readme-ov-file)
so it can be reused by other compiler projects
- Might be able to extract one from
[gig](https://github.com/schurhammer/gig)
- This work is expected to happen in
[glimpse](https://github.com/dusty-phillips/glimpse?tab=readme-ov-file) so
it can be reused by other compiler projects
- Code is very not commented
- (EASY) Should be putting public types, functions, and constants in `__all__`

Expand All @@ -152,28 +157,35 @@ Some tasks below are marked easy if you want to get started.
- type imports are not implemented yet
- not currently generating python type hints (e.g. function arguments and
return types), but gleam gives us that info so may as well use it
- No Result custom type yet (I thought this needed to be in the prelude, but I don't see any result-specific syntax anywhere)
- No Result custom type yet (I thought this needed to be in the prelude, but
I don't see any result-specific syntax anywhere)
- Unlabelled fields in custom types are not generated yet
- Given that labelled and unlabelled fields can be mixed on one class, I have
a feeling we have to ditch dataclasses. Probably a custom class with slots, a
dict of names to indices, and a custom **match_args** that can handle
tuple-like _or_ record-like syntax?
- Labelled parameters in function calls are not transformed (ie `fn foo(bar baz: Str)`)
- Labelled parameters in function calls are not transformed (ie `fn foo(bar
baz: Str)`)
- Codepoints in bistrings are not supported yet
- non-byte-aligned bitstrings are not supported yet
- Fields that are "HoleType" are not supported and I don't even know what that means
- Fields that are "HoleType" are not supported and I don't even know what that
means
- no let assert
- macabre_stdlib only has `io.println`
- Not doing anything to avoid collision between gleam identifiers with python keywords
- Not doing anything to avoid collision between gleam identifiers with python
keywords
- Especially: shadowed variable names behave differently if used in closures
- glance itself doesn't support comments, so these are stripped out of the compiled code
- the standard gleam LSP chokes on the fact that I don't have dependencies in hex
- glance itself doesn't support comments, so these are stripped out of the
compiled code
- the standard gleam LSP chokes on the fact that I don't have dependencies in
hex
- calling functions or constructors with out-of-order positional args doesn't
work in python
- e.g. `Foo(mystr: String, point: #(Int, Int))` can be called with `Foo(#(1,
1), mystr: "Foo")` in gleam
- javascript seems to solve this by automatically reordering the arguments to
match the input type
for all the types in a single class.
- (EASY) maybe call ruff or black on the files after they are output, if they are installed. (shellout is already available)
- See if there are ways to leverage the [gleam_package_interface](https://github.com/gleam-lang/package-interface)
match the input type for all the types in a single class.
- (EASY) maybe call ruff or black on the files after they are output, if they
are installed. (shellout is already available)
- See if there are ways to leverage the
[gleam_package_interface](https://github.com/gleam-lang/package-interface)

0 comments on commit 6feb561

Please sign in to comment.