HNHacker News
TopNewBestAskShowJobs

jarek-foksa

1,958 karma · joined April 19, 2011

I'm the developer of boxy-svg.com and xel-toolkit.org.
submissionscomments
jarek-foksa··on Using Programming Language Concepts to Teach General Thinking Skills (2008) [pdf]
When programming you learn practical ways to distinguish between good and bad abstractions. A good abstraction should make it easier to reason about given problem and make you more efficient. A bad abstraction complicates the problem or even makes it impossible to solve because of the assumptions imposed by the abstract system.

The skill to tell apart working vs non-working abstraction is useful in real life. For example to distinguish a religion from a cult, you don't study the bible or some other holy book, instead you look how that abstract believe system has been working so far, e.g. by checking how many generations have been successfully raised with it and how much progress they made.

You also learn that almost every programming abstraction is leaky to some extent. You are very likely going to run into edge cases where the abstraction needs to be adjusted or replaced with a lower level one in order to get things done. Again, using the religion analogy, sticking to the dogma that the Earth is 6000 years old is going to make it impossible to reason about e.g. the theory of evolution.

jarek-foksa··on Show HN: Xel, widget toolkit for native-like Electron apps
Thanks for feedback. This issue should be resolved now (I had to use window.location.replace() instead of window.location.pathname).
jarek-foksa··on Show HN: Xel, widget toolkit for native-like Electron apps
From the top of my head, Edge is missing: Shadow DOM, Custom Element, HTML Imports, Web Animations, CSS custom properties and CSS path data ("d") property .

In the longer run I'm planning to replace HTML Imports with ES.next modules, so it's temporary dependency.

jarek-foksa··on Show HN: Xel, widget toolkit for native-like Electron apps
This approach works with mostly static or server-side generated websites, but with JS-heavy SPA unsupported browsers would be just showing a blank page.

Currently I'm checking whether the browser supports Custom Elements v1, Shadow DOM v1 and HTML imports. If it does not, I'm showing the fallback page.

jarek-foksa··on Show HN: Xel, widget toolkit for native-like Electron apps
Unfortunately it is not technically possible to polyfill all Web Components APIs. Shadow DOM is especially hard to polyfill in any sensible way (Google did try it, but failed to deliver a solution that would cover all use cases).

I'm sorry for the missing documentation on Github, I will write a proper project description with some examples later next week.

jarek-foksa··on Show HN: Xel, widget toolkit for native-like Electron apps
I would argue that the changes made to macOS HIG in the past ~15 years were rather cosmetic and incremental. It is a moving target, but it is moving very slowly.

Anyway, cloning macOS UI is not my primary goal. I just want to build a widget toolkit that could be themed however I want.

jarek-foksa··on Show HN: Xel, widget toolkit for native-like Electron apps
I was also concerned about the possible copyright claims, therefore I have encapsulated the macOS theme in a single CSS file [1] and I added a more restrictive license to it. I might remove it completely in case I receive any complains from Apple. I'm not using any assets from macOS though, everything is done with plain CSS.

I'm planning to implement ElementaryOS themes [2] as a safer alternative that looks good on both macOS and Linux.

[1] https://github.com/jarek-foksa/xel/blob/master/stylesheets/m...

[2] https://elementary.io/docs/human-interface-guidelines

jarek-foksa··on Show HN: Xel, widget toolkit for native-like Electron apps
It's not a website, it's a single-page app built with Xel, which in turn is an experimental project built with bleeding edge Web Platform technologies such as Custom Elements v1, Shadow DOM v1 or ES2017.

I will implement a proper project website for all browsers when the project matures.

jarek-foksa··on Show HN: Xel, widget toolkit for native-like Electron apps
AFAIK Swing did not have the advanced theming capabilities that are now possible with modern CSS.

Making the HTML widgets look and behave exactly like native Cocoa components is probably not going to happen, but definitely I can do better than Swing or GTK.

jarek-foksa··on Show HN: Xel, widget toolkit for native-like Electron apps
I'm planning to implement a proper fallback site for other browsers with documentation and screenshots later. It's not my top priority right now because the project is still in alpha stage.
jarek-foksa··on Show HN: Xel, widget toolkit for native-like Electron apps
What web browser are you using? I'm unable to reproduce this bug on Safari.
jarek-foksa··on Donations and Women in Tech Panels Are Not a Diversity Strategy
There is the conspiracy theory that the primary goal of diversity initiatives sponsored by big name corporations is to infiltrate the left wing / progressive movements. Then they can derail the political discourse away from important matters like corporate tax evasion, privacy evasion or capital overaccumulation.

I'm not sure whether or to what extent it is true, but I'm defenitely not sold to the idea that they are pushing extremely polarising identity politics purely because of some idealistic reasons.

jarek-foksa··on Genetic evidence for natural selection in humans in the contemporary USA
A brave person that always choses to confront an enemy, no matter how powerful he is, has lower chances for survival, just like a coward who always choses to run away, leaving his resources to the enemy and risking being killed by his own people for treason.

That's why most people of today are neither brave nor cowards, they are somewhere in-between.

jarek-foksa··on Show HN: Task-Based Electron Web Browser
Security-wise, it's a rather bad idea to build a web browser on top of the Atom Electron framework at the moment [1], at least unless you are willing to fork or contribute patches to Electron each time when a new Chrome version with security fixes is released.

[1] https://github.com/electron/electron/issues/5210

jarek-foksa··on Wire of Death
The discussion looks "surprisingly civil" probably because admins were removing comments and threatening users with bans.
jarek-foksa··on How to submit an app to Apple’s App Store when it uses encryption
Which cryptographic algorithms are included in Atom Electron and NW.js frameworks? Does the page [1] list all of them?

[1] https://www.chromium.org/blink/webcrypto

jarek-foksa··on Introduction to the Math of Computer Graphics
"The Matrix and Quaternions FAQ" is also worth reading: http://www.j3d.org/matrix_faq/matrfaq_latest.html
jarek-foksa··on The Fall and Rise of SVG
That's interesting, the computed bbox seems to be slightly off on Chrome when I apply "italic" font style.
jarek-foksa··on The Fall and Rise of SVG
SVG specification distinguishes two types of conforming SVG viewers: static and dynamic [1]. The static viewer does not have to support scripting, animations and user interaction.

A good example of a relatively small static SVG viewer/renderer is libRSVG which is used by GNOME project to render icons.

[1] https://svgwg.org/svg2-draft/conform.html#ConformingSVGViewe...

[2] https://en.wikipedia.org/wiki/Librsvg

jarek-foksa··on The Fall and Rise of SVG
textElement.getBBox().width and textElement.getBoundingClientRect().width should give you the text width in user and client space.
jarek-foksa··on The Fall and Rise of SVG
I'm currently working on an SVG authoring tool written in JavaScript. You can check the project on https://chrome.google.com/webstore/detail/boxy-svg/gaoogdonm...
jarek-foksa··on Animated SVG vs. GIF
XML dependence will become optional in SVG 2 and hopefully it will be deprecated in SVG 3. Chrome team is already considering switching to HTML parser no matter whether the SVG document uses XML or HTML serialization.

<use> elements with external references are tricky due to the same origin policy restrictions and various browser bugs, but referencing local IDs works just fine. Inkscape for example creates clones and symbol instances with <use> elements.

The most obscure part of the paths specification, i.e. the pathSegList interface, is gone in SVG 2. There were some plans to deprecate the "d" attribute and instead introduce a nicer function-based syntax such as data="move(10, 10) line(20, 20)", but AFAIK this idea has been dropped. Still, the path data grammar is clearly defined in the spec, I'm not sure why browser vendors don't follow it.

SVG 2 will support multi-line text and embedded WOFF fonts. This feature is important when you are authoring e.g. UI mockups or posters. Even low level drawing APIs such as canvas have the text primitive. If you express textual content with <path> instead of <text> element then it will not be editable and selectable, screenreaders won't recognize it and search engines won't index it.

jarek-foksa··on Animated SVG vs. GIF
SVG is a complex format, but it's not that bad compared to other widely adopted standards. Just for comparison:

- SVG 1.1 - 826 pages (http://www.w3.org/TR/SVG/REC-SVG11-20110816.pdf)

- HTML 5 - 1156 pages (https://html.spec.whatwg.org/print.pdf)

- ODF 1.2 - 1217 pages (https://www.oasis-open.org/standards#opendocumentv1.2)

- PDF 1.7 - 1310 pages (http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdf...)

SVG 2 spec is even smaller because it removes sections that are either duplicating other W3C standards (filters, styling) or not implemented by all major vendors (animations, fonts, path APIs).

jarek-foksa··on State of emergency in France
I'm not really into the geopolitics and recent news, but what's wrong with this plan? Hopefully the future European governments will be up to something along those lines rather than balkanization followed by the final solution.

1. Move all illegal migrants to a heavily guarded area akin to the Gaza Strip. All EU members would pay for building and maintaining the camps. Base the camps in a non-EU country so that drastic measures could be taken in case situation gets out of control.

2. Don't grant any new citizenships to legal migrants from high-risk countries, instead issue permanent residence permits and then deport anybody suspected of radicalization.

3. Perform full-scale military intervention in the Middle East to restore the old order. Ideally make deal with Russians and Syrian government to take care of the most dirty tasks.

4. Move migrants back to their homeland.

jarek-foksa··on React Color – Color Pickers from Sketch, Photoshop, Chrome and More
Shadow DOM will allow browsers to optimise their rendering code to re-render encapsulated DOM subtrees independently of each other.

Virtual DOM makes sense when (A) you have a huge tree and (B) you show only a small portion of that tree to the user at any given time.

For example a long scrollable list or a multi-line text editor would be better implemented with virtual DOM, but using it everywhere is an overkill.

jarek-foksa··on React Color – Color Pickers from Sketch, Photoshop, Chrome and More
One of the primary selling points of React is better performance of the virtual DOM, which apparently has no prove in benchmarks [1].

[1] https://aerotwist.com/blog/react-plus-performance-equals-wha...

jarek-foksa··on Porting LibreOffice to GTK3 [pdf]
There are at least two such libraries for C# - XWT [1] and Xamarin [2] which AFAIR is based on XWT.

[1] https://github.com/mono/xwt

[2] http://xamarin.com/platform

jarek-foksa··on Fonticons (YC S15) Is A Subscription Icon Service From The Maker Of Font Awesome
I wouldn't put the word "font" in the company name. In the near future SVG symbols may become the preferred way of shipping icons on the web.
jarek-foksa··on Two.js
Why Vector.isZero() is checking whether a vector length is smaller than 0.0001? Why this arbitrary number and not e.g. 0.00000001?
jarek-foksa··on The state of Web Components
ID prefixing won't prevent component internals from leaking to event listeners, querySelector results, TreeWalkers/NodeIterators, innerHTML, and many other APIs.

Native shadow DOM allows me to write components with strict encapsulation on pair with the built-ins such as <button> or <input>, neither framework comes even close to that.

Styles defined inside shadow DOM are always scoped to the local shadow tree, so there is really no need for style[scoped]. Chrome and Opera (and maybe Firefox) support CSS encapsulation inside shadow DOM making the CSS preprocessors less needed.

← PreviousPage 4 of 11Next →