From 6feb561cbbd6ce91fdf7166a0694317cf7b212ca Mon Sep 17 00:00:00 2001 From: Dusty Phillips Date: Sat, 14 Sep 2024 20:00:27 -0300 Subject: [PATCH] Wrap some readme lines --- README.md | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 9566c66..2fa2879 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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__` @@ -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)