HNHacker News
TopNewBestAskShowJobs

hsfzxjy

231 karma · joined February 9, 2021

github.com/hsfzxjy i.hsfzxjy.site
submissionscomments
hsfzxjy··on Font with Built-In Syntax Highlighting
Would like to see a Harfbuzz WASM implementation for this :)
hsfzxjy··on An interactive guide to x86-64 assembly – moving data
The quoted sentence still holds for Arabics, as RTL language has different concept of "first" than LTR ones. :-)
hsfzxjy··on Azure DevOps is down globally
VSCode extension marketplace is also unaccessible
hsfzxjy··on Llama.ttf: A font which is also an LLM
cool. is there a github repo to produce this thing?
hsfzxjy··on Show HN: a Rust based CLI tool 'imgcatr' for displaying images
I've made one years ago, supporting gif

https://github.com/hsfzxjy/i2a-rs

hsfzxjy··on "Real" anonymous functions for Python
Unshamed plug of my project lambdex, which I worked out years ago to bring multilined lambda expressions in Python.

https://github.com/hsfzxjy/lambdex

hsfzxjy··on Show HN: Python-Type-Challenges, master Python typing with online exercises
I passed the test with `object` :)
hsfzxjy··on Show HN: Numbat – A programming language with physical dimensions as types
Remind me of GNU Units https://www.gnu.org/software/units/
hsfzxjy··on Progress on No-GIL CPython
`from __future__ import ` is a specialized statement to indicate flags rather than a runtime statement.

https://docs.python.org/3/reference/simple_stmts.html#future...

hsfzxjy··on Show HN: Playing MAZE Game in gedit with WASM shaper
Hello, everyone! Some days ago, I came across the post BadAppleFont [0] on HackerNews and was intrigued by the possibilities of abusing the HarfBuzz WASM shaper for crazy things.

After some experimentation, I've created a small MAZE game that can be played directly within gedit. This project is far more complicated than the previous one which merely substitutes dots by frame glyphs. Hopefully you will like it!

[0]: https://news.ycombinator.com/item?id=37317055

hsfzxjy··on Jai Programming Language – Resources and Information
Remind me of Mojo
hsfzxjy··on Gothub: Alternative front-end for GitHub written with Go
Any option to turn on Light Mode?
hsfzxjy··on China's slow-moving economic disaster
As a Chinese I would say a lot of people around won't expect this to happen due to a strong sense of nationalism. Most poeple are afraid that these immigrants will create severe security problems as what's happening in the west. And most importantly, people regard it a shame to share with immigrants the already limited job opportunity.
hsfzxjy··on Ask HN: What are some Git aliases you setup that save you time?
The legendary g command to show git traffic:

[alias] g = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all

hsfzxjy··on Beyond Markdown (2018)
Why would a _ be harder to type than a * on a screen keyboard?
hsfzxjy··on πfs – A data-free filesystem
Caveat: data with trailing zeros will share the same location, e.g., 0.1 & 0.010 . A quick fix would be appending a 1 to all data.
hsfzxjy··on Functional Python Programming
Shameless plug. I've once made a library for this https://github.com/hsfzxjy/lambdex
hsfzxjy··on Show HN: Python class typing that raises TypeError at runtime
What's the merit compared with pydantic or beartype?
hsfzxjy··on Show HN: Yaksha Programming Language
A great job! But I found the docs too formal and techincal, which is more like a lang spec. It would be more appealing if some tutorials added.
hsfzxjy··on Adding C-style for loops to Python (2022)
I've attempted something more crazy -- to make Python support multi-line lambda expression [1].

It's done with AST manipulation as well, but on a larger scale and completer functionalities.

[1] https://github.com/hsfzxjy/lambdex

hsfzxjy··on Thonny – Python IDE for beginners
I think he means Thonny is good for freshman who learns by some toy examples, but far from a handy tool for projects of medium or large scale, which a "seasoned" developer would likely build.
hsfzxjy··on So, what can you do with a process ID?
And with strace -p pid you can somewhat "spy" on what a process is doing.
hsfzxjy··on Rust 1.64.0
Still no GAT
hsfzxjy··on Show HN: Human-readable Python datetime formatting
I think when a string "WEEK_NUM_START_MONDAY" given, it will be transformed into "%U_START_DAY" instead of "%W".

You might consider a whole-word matching.

hsfzxjy··on Show HN: Lambdex – Writing more complicated anonymous functions in Python
The package lambdex allows you to write complicated anonymous functions other than the built-in `lambda`s. Take a recursive function that calculates Fibonacci series as an example:

    from lambdex import def_
    def_(lambda n: [
        if_[n <= 0] [
            raise_[ValueError(f'{n} should be positive')]
        ],
        if_[n <= 2] [
            return_[1]
        ],
        return_[callee_(n - 1) + callee_(n - 2)]  # Recursion
    ])(10)  # 55
In the code above, we declare an anonymous function with multiple imperative statements inside, which is more or less similar to the closure in Rust or arrow function in Javascript. There are keywords such as `if_` or `raise_` emulating Python control flows, and brackets `[]` to group statements. Currently, *lambdex* supports nearly all the structures in Python (including the async/await suite), plus several optional language extensions for advanced features.

The "new syntax" requires NO modification on the Python interpreter. Instead it transpiles the ASTs and compiles them to bytecodes at runtime. Even so, lambdex has rather small runtime overhead, since each compiled code object will be cached.

Besides, lambdex provides a formatter for the new syntax, in order to provide better programming experience. The formatter could easily co-operate with other formatters like `yapf`, so that minor changes should be made to enjoy it in an IDE or editor.

Please feel free to try lambdex with your own cases. Discussions and issues are welcomed on Github :-)

← PreviousPage 2 of 2