gilch's Shortform
post by gilch · 2019-08-26T01:50:09.933Z · LW · GW · 26 commentsContents
26 comments
26 comments
Comments sorted by top scores.
comment by gilch · 2019-08-26T01:50:10.196Z · LW(p) · GW(p)
Hissp: It's Python with a Lissp.
(Linkpost for the Hissp tutorial. $ pip install hissp
and follow along.)
Hissp is a programming project I've been working on recently. It's a modular Lisp implementation that compiles to a functional subset of Python--Syntactic macro metaprogramming with full access to the Python ecosystem.
- GitHub repo
- Hebigo: an experimental indentation-based skin for Hissp.
- drython: An earlier experiment of mine that built much of the conceptual foundation for Hissp. Its readme has an introduction to metaprogramming concepts in Python.
↑ comment by Zack_M_Davis · 2019-08-26T03:51:35.462Z · LW(p) · GW(p)
What are the notable differences between Hissp and Hy? (Hyperlink to "Hy" in previous sentence is just for convenience and the benefit of readers; as you know, we're both former contributors.)
Replies from: gilch↑ comment by gilch · 2019-08-26T07:20:14.553Z · LW(p) · GW(p)
They're both Lisps that can import Python, but Hissp has a very different approach and philosophy.
I'm not sure how closely you've been following Hy after you left the project, but for the benefit of other readers, I'll go into a little more detail. As you say, I was also a major contributor to the open-source Hy project, and am still part of the core development team. For a time I was one of the more active members, but my activity has since diminished. I realized that correcting some of Hy's deeper flaws might require a pretty deep rewrite, but building consensus with the few remaining active members of Hy's team proved too difficult. Hy is obviously a much older project than Hissp with more contributors and more time to develop. While my experience with Hy informs my design of Hissp, Hissp is not a fork of Hy's source code, but a completely new project with a fundamentally different architecture.
The biggest difference is that Hy compiles to Python abstract syntax trees (or "AST", an intermediate stage in the compilation of Python code to Python bytecode). In contrast, the Lissp language uses Hissp as its AST stage instead, and compiles that to Python code, which Python then compiles normally. Hy compiles to a moving target—Python's AST API is not stable. This helps to make Hissp's compiler simpler than Hy's.
Hissp code is made of ordinary Python tuples that serve the same role as linked lists in other Lisps, or Hy's model objects. Using these directly in Python ("readerless mode") is much more natural than writing code using Hy's model objects, although using the Lissp (or Hebigo) language reader makes writing these tuples even easier than doing it directly in Python.
Hissp is designed to be more modular than Hy. It supports two different readers (Lissp and Hebigo) with the potential for more. These compile different languages that represent the same underlying Hissp-tuple AST. The separate Hebigo language is indentation based, while the included Lissp reader uses the traditional s-expressions.
Hy code requires the hy
package as a dependency. You need Hy's import hooks just to load Hy code. But Hissp only requires hissp
to compile the code. Once that's done, the output has no dependencies other than Python itself. (Unless you import some other package, of course.) This may make Hissp more suitable for integration into other projects where Hy would not be a good fit due to its overhead. Hissp has already attracted some interest from the symbolic-pymc project for this reason.
Hy's compiler has a special form for every Python statement and operator and has to do a lot of work to create the illusion that its statement special forms behave like expressions. This complicates the compiler a great deal, and doesn't even work right in some cases, but allows Hy to retain a very Python-like feel. The decompiled AST also looks like pretty readable Python. Not quite what a human would write, but a good starting point if you wanted to translate a Hy project back to Python.
But after writing Drython, I realized that the expression subset of Python is sufficient for a compilation target. There is no need to do the extra work to make statements act like expressions if you only compile to expressions to begin with. It turns out that Hissp only required two special forms: quote
and lambda
. This makes Hissp's compiler much simpler than Hy's. But the lack of statements makes it feel a bit more like Scheme and a bit less like Python. And, of course, the expression-only output is completely unpythonic.
Another major difference is Hissp's qualified symbols. This allows macros to easily import their requirements from other modules. Macro dependencies are much harder to work with in Hy. I suggested a similar solution, but it has not been implemented in Hy so far.
I haven't covered every feature of Hissp, so there are more differences. See the tutorial and FAQ for a bit more thorough overview.
comment by gilch · 2021-08-26T05:49:20.366Z · LW(p) · GW(p)
I currently have a small percentage of my portfolio in Ethereum. I'm considering making it a large percentage, maybe 20%, due to the Squish Chaos report. It was mentioned here on LW earlier, but didn't generate much discussion. Squish claims to be about 90% in Ether. The case seems compelling: Ether price could easily go up 7x on fundamentals and maybe 50x in the short term, probably within a year, at least according to the report. If true, this is an amazing opportunity, similar to being a Bitcoin early adopter, but the case seems too one-sided. I'm detecting a whiff of greed and groupthink from some other traders I've been discussing this with.
He who knows only his own side of the case, knows little of that. His reasons may be good, and no one may have been able to refute them. But if he is equally unable to refute the reasons on the opposite side; if he does not so much as know what they are, he has no ground for preferring either opinion. —J.S. Mill
So can someone please talk me out of it?
My best counter-case so far: Ether is extremely volatile and has dropped 90% before. (But eventually recovered.) Crypto is very over-hyped generally. (But this report seems unusually well-researched.) If I took every crypto bet that seemed good, I'd quickly lose my shirt. (But I rarely make bets this size. Even if I'm wrong, I'd probably recover from an ~18% loss within a year from my other investments.) By the EMH, if the future price is known, it should cost that much already, sans the risk-free rate and premium for risk. (But crypto markets are clearly not efficient yet, Squish makes a case why this can't be priced in yet.) Any time there's an Ethereum software update, we risk a hack. (The risk is still worth it, and another update could reverse losses, cf Ethereum Classic origin.) Ethereum is a bubble/ponzi scheme that could collapse at any moment. (Ethereum might have a better case on fundamentals that Bitcoin. Since Bretton Woods, fiat is also ponzi-like, yet stable enough due to policy. Squish suggests that Ether should be worth 7x current value on fundamentals alone.) The fundamental valuation is circular: smart contracts are only useful for making more kinds of tokens. (Even assuming 0 fundamental value, current prices are much higher than 0 now. Canada already has an ETF for Ether, the US will probably follow suit.)
comment by gilch · 2021-01-17T05:44:25.178Z · LW(p) · GW(p)
Announcing the release of Hissp 0.2.0, my Lisp to Python transpiler, now available on PyPI.
I've overhauled the documentation with a new quick start in the style of Learn X in Y minutes, and a new macro tutorial, among other things.
New features include raw strings, module literals, unqualified reader macros, escape sequences in symbols and improvements to the basic macros.
Replies from: Pattern↑ comment by Pattern · 2021-01-17T21:02:40.840Z · LW(p) · GW(p)
I suggest putting those links inside those links. For example, on the github page, changing:
Also available on PyPI.
to
Also available on PyPI.Replies from: gilch
↑ comment by gilch · 2021-01-19T06:33:30.854Z · LW(p) · GW(p)
Added that PyPI link to the release page. Although it was referring to the pip install
command below that.
comment by gilch · 2022-09-27T19:03:27.761Z · LW(p) · GW(p)
As always, not investment advice. There are signs that a volatility spike is imminent, which often coincides with a market drop. I have reversed my usual short vol position and bought tail insurance (e.g. OTM puts). Remember vol can fall just as quickly. How long a spike lasts depends on how high it goes.
comment by gilch · 2022-02-14T00:16:53.782Z · LW(p) · GW(p)
Hissp 0.3.0 is up. Check it out.
pip install -U hissp==0.3.0
Replies from: zac-hatfield-dodds↑ comment by Zac Hatfield-Dodds (zac-hatfield-dodds) · 2022-02-14T07:53:52.079Z · LW(p) · GW(p)
Hey, the example uses Hypothesis 😁 Always nice to see it in the wild.
Replies from: gilch↑ comment by gilch · 2022-02-15T06:05:33.504Z · LW(p) · GW(p)
Hypothesis was invaluable for getting the Unicode munging working properly. So many edge cases.
Replies from: zac-hatfield-dodds↑ comment by Zac Hatfield-Dodds (zac-hatfield-dodds) · 2022-02-15T06:48:54.548Z · LW(p) · GW(p)
Oh yeah. My personal favourite is the NFKD-normalization of identifiers, though I haven't built that into hypothesmith yet.
comment by gilch · 2021-01-27T23:40:46.899Z · LW(p) · GW(p)
I'm seeing some serious stock market instability starting near the end of the trading day today. The volatility curves are making me nervous. Sometimes it passes without much happening, but I think there's an elevated risk of a market crash in the next day or three. I can't say how hard. If this instability persists tomorrow morning, I'll be taking some precautions, probably going long volatility. If I had been paying more attention, I might have done this at the end of the trading day today. [As always, I am not your financial advisor, and without knowing your financial situation this cannot be financial advice. Please don't bet the farm. [LW · GW] You are responsible for your own money.]
Charting is mostly superstition [LW · GW]. This isn't based a gut feel, but on some statistical analysis of past market behavior that has been reliable enough in the past for me to take seriously. I'll try to remember to update this thread in the morning.
Replies from: gilch, Gunnar_Zarncke, gworley↑ comment by gilch · 2021-01-28T14:41:43.844Z · LW(p) · GW(p)
At market open, the instability I was seeing appears to have passed. That did not last long. I'll keep checking it.
Replies from: gilch↑ comment by gilch · 2021-01-29T17:35:34.169Z · LW(p) · GW(p)
It's a day later, and I'm seeing it again, but barely. I want to see if it persists a while before acting so I don't get whipsawed.
Replies from: gilch↑ comment by gilch · 2021-02-02T21:03:28.462Z · LW(p) · GW(p)
The instability appears to have passed. I didn't go long vol, although I had rebalanced early to reduce some dangerous exposure and reduced my usual small short vol position. I've now restored my usual short vol position. It could be months before we see a blip like this again.
↑ comment by Gunnar_Zarncke · 2021-01-28T11:49:28.819Z · LW(p) · GW(p)
I bought VIX a while ago when it was at 22 expecting this and while it took longer to go up than I expected but it is now rising and at >30 (peak during early Covid was > 60).
↑ comment by Gordon Seidoh Worley (gworley) · 2021-01-28T01:27:35.446Z · LW(p) · GW(p)
I have the same concern. I've been worried about a bubble for a while given all the extra money in stocks pushing up prices well past fundamentals. I expect a correction, but it's hard to know when the market will coordinate to do it because of lack of other places to put stuff. Today felt nuts in a way I expect a reaction. Consequently, I've put my money where my mouth is and rebalanced my portfolio to be more conservative for a while.
comment by gilch · 2024-11-12T20:46:14.141Z · LW(p) · GW(p)
Hissp v0.5.0 is up.
python -m pip install hissp
If you always wanted to learn about Lisp macros, but only know Python, try the Hissp macro tutorials.
Replies from: shankar-sivarajan↑ comment by Shankar Sivarajan (shankar-sivarajan) · 2024-11-12T21:39:36.599Z · LW(p) · GW(p)
Is this a Lisp-to-Python transpiler?
Replies from: gilchcomment by gilch · 2022-09-02T20:39:44.939Z · LW(p) · GW(p)
Reminder that "The Merge" for Ethereum is coming up soon. There are bullish signs, like call-to-put ratios. Totally not advice, and please Don't bet the farm [LW · GW]; crypto has high volatility.
comment by gilch · 2022-02-24T16:43:13.778Z · LW(p) · GW(p)
I'm seeing some serious stock market instability this morning. I'm calling it. Market is crashing. I can't say how hard or for how long. The reasons should be obvious, but I'll say it: the present war in Ukraine.
I'll be taking some precautions, including going long volatility, and buying some index puts. I am not your financial advisor, but seriously, take a look at your portfolio RIGHT NOW!
These are short-term plays. Theoretically, puts will rapidly deflate in value once the market bottoms, so if one were to buy some defensively (or aggressively), one should be prepared to sell them quickly after volatility peaks.
Charting is mostly superstition. This isn't based a gut feel, but on some statistical analysis of past market behavior that has been reliable enough in the past for me to take seriously. I'll try to remember to update this thread when I sell off my puts.
ETA: For those who can't trade options, there are inverse index ETFs, which are also short-term plays. These may not be available to everyone. It may also be prudent to scale back any broad market exposure (i.e. anything correlated with the S&P 500) in proportion to current volatility, until the current volatility spike passes. This follows from Kelly. Whatever you do, don't jump off at the bottom. This too shall pass.
Replies from: gilch, gilch