Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
lihaoyi
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
47 ms
·
601.
▲
Messing with Python's semantics using Macros
(stackoverflow.com)
1 points
by
lihaoyi
13y ago
|
0 comments
602.
▲
JS Snippets: Cross compiling snippets of Python to Javascript
(github.com)
2 points
by
lihaoyi
13y ago
|
0 comments
603.
▲
Xmlite: a lightweight markup language that compiles to XML
(github.com)
3 points
by
lihaoyi
13y ago
|
0 comments
604.
▲
Writing your first Macro in Python
(github.com)
1 points
by
lihaoyi
13y ago
|
0 comments
605.
▲
by
lihaoyi
13y ago
Hey All, MacroPy is basically finished in its current state, as a proof of concept and bundle of demos. Next steps include breaking the macros themselves into separate project and polishing the core into a solid foundation for others to bui
606.
▲
Scala.Rx: Functional Reactive Programming for Scala
(github.com)
1 points
by
lihaoyi
13y ago
|
1 comments
607.
▲
Reactor.js: Functional Reactive Programming in Javascript
(github.com)
2 points
by
lihaoyi
13y ago
|
0 comments
608.
▲
by
lihaoyi
13y ago
- Off-by-one errors should be security vulnerabilities, rather than just crashes
609.
▲
by
lihaoyi
13y ago
MacroPy now works with the CPython REPL: PS C:\Dropbox\Workspace\6.945\Project> python Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for
610.
▲
by
lihaoyi
13y ago
The homework assignments are all online; One of the project requirements is that the code be hosted somewhere public where people can go and see it, so it'd probably be pretty easy to get a list from the prof
611.
▲
by
lihaoyi
13y ago
If you're serious about wanting to contribute, my email is on my GitHub profile, so ping me and I can help you get up to speed!
612.
▲
by
lihaoyi
13y ago
Author here, I just put up a Detailed Guide: https://github.com/lihaoyi/macropy#detailed-guide That goes into more detail of how macros are written, and walks you through writing a simple but useful macro (the quicklambda macro). This sho
613.
▲
by
lihaoyi
13y ago
Yeah, we haven't looked at performance at all. "The Wonderful Thing About A Dancing Bear Is Not How Well He Dances, But That He Dances At All" We'll get to teaching him to dance well later!
614.
▲
by
lihaoyi
13y ago
Yep, there's an issue for that! https://github.com/lihaoyi/macropy/issues/14 I've also gotten a basic implementation working in the CPython REPL, which requires you to run a function `macro_repl()` before you can use them. A Macro powered
615.
▲
by
lihaoyi
13y ago
Laziness; we already had it installed. That's what a lot of other people are using. It's not that we don't like Python3; their ASTs are considerably simpler (e.g. no print statement), they have importlib, and a bunch of other nice things. I
616.
▲
by
lihaoyi
13y ago
I'd argue that "fields as a string with spaces inside, or maybe a list of strings" is changing language semantics quite a bit. We're used to namedtuples doing it like this now, but if namedtuples didn't exist, "fields as a list of strings w
617.
▲
by
lihaoyi
13y ago
- The classes do inherit from object, iirc - We know the nesting is controversial; whether it will remain in its current form has yet to be seen. I think there is some merit in this way of doing it, we know others disagree
618.
▲
by
lihaoyi
13y ago
We do take it seriously; it's a hard tradeoff between Novelty and Utility. Given that the whole point of macros is to change the semantics of the Python language, this (valid) criticism applies not just to case classes but macros in general
619.
▲
Scala.Rx: is an experimental change propagation library for Scala
(github.com)
3 points
by
lihaoyi
13y ago
|
0 comments
620.
▲
by
lihaoyi
13y ago
It definitely looks funny from a python point of view; it's inspired by ADTs and OCaml. Perhaps it would be better to leave them to be accessed via a qualified name (e.g. `List.Nil`, `List.Cons`). This is all up for debate.
621.
▲
by
lihaoyi
13y ago
Author here. The `<<` operator is being abused to mean "bind", so the right side is a normal expression (constructing a Foo and Bar) and the left side matches it to a particular "shape". The purposes of pattern matching is to replac
622.
▲
by
lihaoyi
13y ago
Author here. If you look at my github, you'll see I do use plenty of Scala!
623.
▲
Macros in Python
(github.com)
300 points
by
lihaoyi
13y ago
|
66 comments
624.
▲
LINQ to SQL, in Python
(github.com)
1 points
by
lihaoyi
13y ago
|
0 comments
625.
▲
by
lihaoyi
13y ago
Thanks! We put a lot into it the past few weeks
626.
▲
Macros in Python: quasiquotes, case classes, LINQ and more
(github.com)
8 points
by
lihaoyi
13y ago
|
2 comments
627.
▲
Writing a JSON parser in Python
(github.com)
3 points
by
lihaoyi
14y ago
|
0 comments
628.
▲
MacroPy Parser Combinators: Pushing the limits of embedded DSLs in Python
(github.com)
1 points
by
lihaoyi
14y ago
|
0 comments
629.
▲
Macros in Python: quasiquotes, string interpolation, LINQ and more
(reddit.com)
2 points
by
lihaoyi
14y ago
|
0 comments
630.
▲
by
lihaoyi
14y ago
Yep, it's a pity they won't. Even so, many of the macros (e.g. log/trace) are the sort of thing that will be super useful even if they never get checked into Version Contrl. I know I spend a lot of time peppering `print "A"` `print "B"` sta
More ›