-
Notifications
You must be signed in to change notification settings - Fork 38
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
WIP: Improve legibility #63
Conversation
Codecov Report
@@ Coverage Diff @@
## master #63 +/- ##
=======================================
Coverage 90.46% 90.46%
=======================================
Files 19 19
Lines 556 556
=======================================
Hits 503 503
Misses 53 53 Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #63 +/- ##
=======================================
Coverage 90.46% 90.46%
=======================================
Files 19 19
Lines 556 556
=======================================
Hits 503 503
Misses 53 53 Continue to review full report at Codecov.
|
Yes, I think GADT/ADT here is just the thing you used for Symbolics.jl, where Op and Symbols are subtypes of Expr. @MasonProtter Edit: In principal, this should make these kind of making these eDSL and writing parsers much simpler with less code. I think that's the purpose of this package. It was originally built for Py2Jl.jl IIRC. |
README.md
Outdated
@@ -62,7 +62,7 @@ Finally, we finish such a library that provides **extensible pattern matching** | |||
|
|||
- Performance Gain | |||
|
|||
When dealing with complex conditional logics and visiting nested datatypes, the codes compiled via `MLStyle.jl` could always match the handwritten. You can check [Benchmark](#benchmark) for details. | |||
When dealing with complex conditional logics and visiting nested datatypes, the codes compiled via `MLStyle.jl` is usually ass fast as handwritten code. You can check the [benchmarks](#benchmark) for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo here? lmao
ass -> as ;-)
Firstly, thank you sooo much for your works. I've read a few of your changes, which does make sense but with a few typo issues still. When you feel like to merge, just ping me and I'll do a thorough review then. Sorry that I cannot answer all your questions above for I'm busy now.
Your understanding of ADT equivalent notations is almost right but not that accurate. Just simply defining some structs will not provide you with the support of pattern matching. Check as_record macro.
It's called the GADT notation, though it's not implememted completely. I'll reformat my post later, and make more detailed explanations. |
I think we could merge this, and make more documentation and docs later. The revision looks good to me. |
@Roger-luo Okay, you can just merge this after finishing reviewing this PR. Sorry that I don't have time to deal with this now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review: Improve legibility
|
||
|
||
## Motivation | ||
|
||
The people who're used to so-called functional programming could become retarded when there're no pattern matching and ADTs, and of course I'm one of them. | ||
Those used to functional programming may feel limited when they don't have pattern matching and ADTs, and of course I'm one of them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I was trying to play a Chinese meme when writing this down... However, it seems not that work in English...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I could tell it was a playful joke, but its also the sort of joke many english speakers would find offensive so I figured it may be safer to cut it.
|
||
|
||
### Homoiconic pattern matching for Julia ASTs | ||
Here's a less trivial use of MLStyle.jl for deconstructing and pattern matching julia code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
@MasonProtter is this still WIP? should I merge it? |
Co-Authored-By: Rogerluo <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #63 +/- ##
=======================================
Coverage 90.46% 90.46%
=======================================
Files 19 19
Lines 556 556
=======================================
Hits 503 503
Misses 53 53 Continue to review full report at Codecov.
|
2 similar comments
Codecov Report
@@ Coverage Diff @@
## master #63 +/- ##
=======================================
Coverage 90.46% 90.46%
=======================================
Files 19 19
Lines 556 556
=======================================
Hits 503 503
Misses 53 53 Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #63 +/- ##
=======================================
Coverage 90.46% 90.46%
=======================================
Files 19 19
Lines 556 556
=======================================
Hits 503 503
Misses 53 53 Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #63 +/- ##
=======================================
Coverage 90.46% 90.46%
=======================================
Files 19 19
Lines 556 556
=======================================
Hits 503 503
Misses 53 53 Continue to review full report at Codecov.
|
It's up to you if you want to merge these in parts or all at once. It'll probably be a long time before I can get through all the docs pages. |
cool merged. |
I find this package really interesting, but if I'm being honest I find the documentation and README quite hard to understand and I find the examples to be too advanced for me as someone who is not an ML user.
This PR is meant to be a work in progress where I correct some grammar and add more simple examples so that more julia users can tell what this package is good for.
I'm still trying to understand the documentation on algebraic data types. For instance, when you write
there's no explanation of what this means. After some playing around, I see that it is more or less equivalent to
Are there any other differences?
What confuses me more is
I'm struggling to understand what exactly
C2{A} :: Vector{A} => C{A}
is meant to do.