Polyglot

󰃭 2025-09-08

While nimpylib(repo) is handy to write Python code in Nim,

what if writing polyglot code, which is runnable in both Nim and Python?

An example (NPython’s test_decimalAndSpace.nim) using such polyglot


How to

We simply write two parts:

  • run in both languages (thanks to their similar syntax)
  • snippets run in only one, ignored by another

Many parts of syntax of they two are similar, so we don’t discuss such here

and what’s more important is that how to make some code ignored by specified one language

Continue reading 


Unicode Space

󰃭 2025-02-16 | #daily-trick #tech

Introducion

Some online chat clients, like WhatsApp, WeChat and Identity V, reject empty as well as space message.

But once you wanna send blank message, there’s a workaround for WhatsApp and WeChat: just use Unicode Spaces

Workaround

That’s due to WeChat’s isspace only checks ASCII space (U+0020) but not others.

One of the most commonly used is U+2000 ("\u2000" in python):

not worked for Identity V

Continue reading 


Hello2025

󰃭 2025-01-28 | #celebrate

Hello New Year 2025

Happy China New Year!

Everyone!

In my opinion, the very part of this new year to commemorate is “It’s Python Year”

Yep. Have fun.

Continue reading 


Hello

󰃭 2025-01-13 | #hello

Hello, Welcome

Welcome to u!

Here’s my blog website, where I’d like to share somthing about my daily experiement as well as my notes.

Continue reading 