re2c icon indicating copy to clipboard operation
re2c copied to clipboard

Add Swift support

Open skvadrik opened this issue 1 year ago • 2 comments

Requested in https://www.linux.org.ru/news/development/17798640?cid=17800037

skvadrik avatar Nov 22 '24 08:11 skvadrik

By the way, is there a use case for support of such high-level languages? For instance, wouldn't it be better to use ANTLR? It is amazing that re2c generates a static state machine without any memory allocation. I can use it on a microcontroller. But when it comes to languages like Java, does it matter?

PolarGoose avatar Dec 01 '24 03:12 PolarGoose

Perhaps there is a use case, since people request it. For Swift in particular, let's ask @data-man .

For some high-level languages like OCaml and Haskell re2c may be a performance benefit (e.g. Haskell is famous for its parser combinators, but they are not as fast as a combination of lexer generator and LALR parser). For languages like JS or Python my expectation is that decent performance can only be achieved with C/C++/Rust libraries that have high-level bindings, so re2js/re2py cannot compete there. But some users still want re2c for its syntax, as in case of JavaScript: https://github.com/skvadrik/re2c/issues/420.

skvadrik avatar Dec 01 '24 07:12 skvadrik

Completed in https://github.com/skvadrik/re2c/pull/538.

skvadrik avatar Apr 14 '25 16:04 skvadrik