HN user

RazrFalcon

86 karma
Posts2
Comments33
View on HN

RustyBuzz is quite limited when compared with HarfBuzz.

As the main author of rustybuzz I'm surprised to hear this. If you need a text shaper, rustybuzz is mostly a drop-in replacement for harfbuzz.

Text shaping and TrueType parsing are hard problems, but Rust does not make them more complicated. Quite the opposite. In fact, rustybuzz is written in 100% safe Rust. I would even go further and say that Rust is the only sane option for solving text-related tasks.

While I do like Swift and wish Rust would look as nice, it doesn't have references and lifetimes. Those two alone make code way nicer.

Anonymous closure arguments, aka $0, are probably the ugliest part of its syntax.

    numbers.contains(where: { $0 > 0 })
Rust's Ugly Syntax 3 years ago

At least Swift exists :)

But sure, there are a lot of interesting languages out there. I would love to use something other than Rust, but there are simply no choice.

Rust's Ugly Syntax 3 years ago

You're basically describing Swift:

    public func read(path: URL) throws -> Array<UInt8> {
        let file = try FileHandle(forReadingFrom: path)
        let bytes = try file.readToEnd() ?? Data()
        return Array(bytes)
    }
Yes, the example above is not generic and not even idiomatic Swift, but it's a good glimpse into how Rust could look like.

Hopefully someday Swift would become more safe, less tied to ObjC legacy and actually cross-platform. It's a shame that such a nice language is basically Apple-only.

How much work would it be to port over the C# SVG→TinyVG converter to Rust based on resvg?

Probably a day, as long as you know Rust. I can take a look into it if you're interested. usvg (the SVG parser of resvg) is specifically designed to convert a real world SVG with all its quirks into a machine readable, minimal SVG/XML.

One thing to note is that usvg doesn't preserve text at the moment (will be converted into paths automatically) and Quadratic curves.

PS: I also have a longer, but still unfinished rant [0] over SVG complexity if you're interested.

[0] https://github.com/RazrFalcon/resvg/blob/master/docs/renderi...

A small nitpick as the resvg author: the repo located here https://github.com/RazrFalcon/resvg I'm not sure why the author linked some random, outdated fork. If you're trying to beat SVG, you should have done a better research.

But yes, SVG is extremely bloated and under-documented. Especially SVG 2. The core resvg codebase is close to 20 KLOC, while the whole package is like 50 KLOC.

On the other hand, resvg is an exception, because it doesn't rely on any system and/or 3rd party libraries. 95% of the code in the final binary was written by one person (me). Not because it was strictly required, but because it was fun. resvg is basically an epitome of RIIR.

because they support binary dependencies

Without an ability to tweak build flags. Which makes them useless. And since they are not really crossplatform either, you better stick with portage, which is still far behind cargo.

I'm using QtC daily too, and it's far from perfect.

- It still can't handle most of the CMake projects.

- Refactoring/autocompletion/go-to-definition doesn't work on a heavy-templated code.

- Clang must be patched to work correctly (at least code analyzer doesn't work out of the box).

- Code generation sometimes produces malformed code.

- No ANSI escape codes support in terminal/output.

- Random crashes.

IDEA with Rust plugin is years ahead.

Bloated 8 years ago

I came here to write the same. svgcleaner[1] will reduce it from 8.4KiB to 1.3KiB (compressed with zopfli). Which is 85% smaller.

And a manually crafted one is just 477B. And 261B compressed. Which is just 3% of the original.

Now we can talk about bloatedness.

  <svg width="601" height="751" xmlns="http://www.w3.org/2000/svg">
    <rect width="600" height="750" rx="38" fill="white" stroke="black"/>
    <rect x="16" y="16" width="568" height="718" rx="24" fill="none" stroke="black" stroke-width="15"/>
    <text text-anchor="middle" font-family="Arial" font-size="150" font-weight="bold">
        <tspan x="300" y="200">FPS</tspan><tspan x="300" y="350">LIMIT</tspan><tspan x="300" y="660" font-size="350">15</tspan>
    </text>
  </svg>
[1]: https://github.com/RazrFalcon/svgcleaner

If we are talking about C++ then the problem is that there a too many build systems and all of them are incompatible.

CMake is quite popular (and maybe most popular) but it's a complete horror in comparison to other build systems, especially for other languages (like Cargo for Rust).

If you need some specific example: try to add a git-based dependency with a specific branch in CMake.

SVG is not a colored paths container. There are far more things that it can do and far more ways to optimize it.

Instead of SVGO you can use svgcleaner[1] with zopfli, which is a bit better.

Yes, nothing compares to manual optimizations, but if you created an SVG using a vector editor - there is no point in manually removing all the garbage it adds in.

1: https://github.com/RazrFalcon/svgcleaner

Sublime Text 3.0 9 years ago

I know it will be supported by the community

They won't. Projects like Atom and VSCode thrives because they have big companies behind them. Remove them - and the project will die.

There are tons of abandoned text editors on GiHub.