from Hacker News

Show HN: I built an embeddable Unicode library with MISRA C conformance

by hgs3 on 12/15/24, 3:41 PM with 48 comments

Hello, everyone. I built Unicorn: an embeddable MISRA C:2012 implementation of essential Unicode Algorithms.

Unicorn is designed to be fully customizable: you can select which Unicode algorithms and character properties are included or excluded from compilation. You can also exclude Unicode character blocks wholesale for scripts your application does not support. It's perfect for resource constrained devices like microcontrollers and IoT devices.

About me: I quit my Big Corp job a few years back to pursue my passion for software development and this is one of my first commercial releases.

  • by Someone on 12/15/24, 5:49 PM

    On https://railgunlabs.com/unicorn/manual/misra-compliance/, I think you will want to fix a typo in

      1.2    Required    Compliant (verified by compiling with Clang's -pdentic flag)
                                                                       ^^^^^^^^
    
    Or am I too pedantic?
  • by chris_wot on 12/15/24, 4:40 PM

    I don’t get the whole MISRA requirement that functions should only have one exit point. Honestly, nobody has been able to explain why this is important, other than it’s a historical anomaly inherited from FORTRAN. (Which was actually for a good reason)
  • by rubicks on 12/15/24, 4:32 PM

    This is not a comment about open/closed-source software and/or licensing models.

    Projects like this never fail to impress me vis-a-vis source obfuscation. The 'generate.pyz' is an interesting twist on the usual practice.

  • by __turbobrew__ on 12/15/24, 6:36 PM

    There is not much to show if I can’t read the source code.
  • by kiritanpo on 12/15/24, 5:15 PM

    This looks interesting. Most embedded project I know use ICU/libicu for their unicode needs. As a potential customer I would like to know how does it compare against ICU for performance and code size. Why should I switch?
  • by garganzol on 12/16/24, 2:53 AM

    My comment is not directly related to the particular project which is impressive, but more to its presentation. If you go to the author's website, you will find neat to-the-point manuals and other useful information. This is what I call the real Web 3.0. Simple and to the point. Also the main company page is humorous in a good way, about the mad scientist etc.
  • by biosboiii on 12/15/24, 8:01 PM

    Since MISRA is targetted at Automotive, as a software dev in the automotive space I would suggest adding the note that this is able to run on POSIX compliant OSes like QNX :)

    If you would like to chat, hit me up.

  • by tocariimaa on 12/15/24, 6:34 PM

    It uses a privative license if you're wondering.
  • by rurban on 12/15/24, 5:29 PM

    This is commercial only. Free and small is my safeclib, which does about half of it. ICU is not usable on small devices, and also pretty slow. It's much faster to use precomputed tables per algorithm, such as here or in safeclib. libunistring is also extremely slow. This was tried for grep and failed.
  • by sushidev on 12/15/24, 4:20 PM

    Nice!