4 ms·
As someone who switched from python to Julia, Julia syntax supports things like list comprehensions, but also many better things like broadcasting that python r
by jarbus 4y ago
As someone who switched from python to Julia, Julia syntax supports things like list comprehensions, but also many better things like broadcasting that python really needs. The only thing python has over Julia is that Julia requires an “end” keyword where python uses indentation. But julia has so much more than python (like macros) that it’s just better syntax wise.
- BerislavLopac 4y agoPython has macros too.
- adgjlsfhk1 4y agoas of 2020 (PEP 638), python has macros (but they're still slightly janky). Before that there were decorators which look kind of similar but are a lot less powerful.
- nerpderp82 4y agoAre they implemented anywhere? It looks like the PEP is draft. You can do all the macro like things you want using framehacks and eval at the top level. Where they are hard to apply w/o direct support is down inside some function. Then you have to bytecode patch the result on first execution.
- mathisfun123 4y ago> as of 2020 (PEP 638) >> Reference Implementation >> None as yet. > but they're still slightly janky maybe you're from the future?
- BerislavLopac 4y agoNot just decorators, but all kinds of functionalities that allowed types to be constructed at runtime.
- xiaodai 4y agowell. python has ALOT of stuff but alot of it is garbage compared to how they should be done. like python's lambda, you literally have to write the word lambda. it's ugly af i bet the python macros will be ugly af too. also walrus operator = bdfl no more.