HackerTrans
TopNewTrendsCommentsPastAskShowJobs

aarchi

no profile record

comments

aarchi
·3 tahun yang lalu·discuss
PostgreSQL is Turing-complete, as proven by implementations of a cyclic tag system[0] and Turing machine[1]. The Mandelbrot set[2] and travelling-salesman problem[3] have also been implemented in it.

Transact-SQL is also Turing-complete, as proven by a Brainfuck implementation[4].

With that, you can theoretically compute anything :).

[0]: https://wiki.postgresql.org/wiki/Cyclic_Tag_System

[1]: https://blog.coelho.net/database/2013/08/17/turing-sql-1.htm...

[2]: https://wiki.postgresql.org/wiki/Mandelbrot_set

[3]: https://web.archive.org/web/20201111224603/http://assets.en....

[4]: https://stackoverflow.com/questions/900055/is-sql-or-even-ts...
aarchi
·3 tahun yang lalu·discuss
I'm currently building a couple of regexp engines:

One, that's a formalization[0] in Coq with big-step semantics, which uncommonly has the intersection operator, and includes several equivalence relations and a proof of the pumping lemma, excepting one case (more on that below).

As a learning exercise and for historical reasons, I've also mostly ported Rust Cox's re1 engine to Rust[1], which includes VM matchers in the style of Henry Spencer, Ken Thompson, and Rob Pike. I also plan to port Doug McIlroy's engine[2], which is interesting for having intersection and complement and special handling for sublanguages, all the way down to just concatenation matched with Knuth-Morris-Pratt. I also want to examine the Rust (thanks burntsushi!), RE2, and Plan 9 engines in more depth.

Once I have time to get back to the project, I want to get back to my regular expression crossword puzzle solver. For that, I'm converting the hint regexps to DFAs, that match strings of some fixed length, and concatenating and intersecting them, until a single regexp is yielded, which should be a string literal, if the puzzle has a single solution. For backreferences, it's more tricky, but I plan on rewriting backreferences to the captured expression, where the lengths of both match, then either executing it with a stack like a pushdown automata or constructing a set of constraints on the characters by index.

As an aside: In my proof of the pumping lemma[3], I got stuck on the case for intersection and I'd love insight. Regular languages are closed under intersection, so the pumping lemma should hold for my implementation. I need to prove that if s =~ re1 and s =~ re2 can be pumped, then so can s =~ And re1 re2. s is is split into different substrings for re1 and re2, s = s11 ++ s12 ++ s13 = s21 ++ s22 ++ s23, then repeated an arbitrary number of times, (forall n, s11 ++ repeat s12 n ++ s13 =~ re1) and (forall n, s21 ++ repeat s22 n ++ s23 =~ re2). My intuition is that s11 = s21, s12 = s22, and s13 = s23, because they both match for the intersection, but I'm not convinced of that and haven't been able to formulate a proof for that.

0: https://github.com/thaliaarchi/recross-coq

1: https://github.com/thaliaarchi/re1-rust

2: https://github.com/arnoldrobbins/mcilroy-regex

3: https://github.com/thaliaarchi/recross-coq/blob/main/theorie...
aarchi
·3 tahun yang lalu·discuss
The (preprint) paper links to its repository, where its code eventually will be. I suspect it will be pushed around August 2023, before USENIX Security'23, where it will be published.

https://github.com/sslab-gatech/autofz
aarchi
·3 tahun yang lalu·discuss
> Other contamination was also found in or on: three buses, 42 houses, fourteen cars, five pigs, and 50,000 rolls of toilet paper

Why such a large figure for toilet paper? Is it somehow more easily contaminated by radiation?
aarchi
·3 tahun yang lalu·discuss
This makes me want to dump all my TI-Basic programs from my calculator and put them into source control.
aarchi
·4 tahun yang lalu·discuss
I just got a terrible idea: combine this with another project, that built Tetris in Conway's Game of Life. That would enable executing an arbitrary program in Tetris, simulated in Game of Life.

https://codegolf.stackexchange.com/questions/11880/build-a-w...
aarchi
·4 tahun yang lalu·discuss
Zettelkästen certainly aren't new, as the technique was popularized in the 1950s and had been around for much longer.
aarchi
·4 tahun yang lalu·discuss
Try doing it in Whitespace then :)

https://github.com/andrewarchi/ws-challenges
aarchi
·4 tahun yang lalu·discuss
I've created a similar repo of puzzles, including Advent of Code, but solved in the Whitespace programming language. Even otherwise easy puzzles are made significantly more difficult in Whitespace, as it is a quite low-level language. The control flow feels like coding in assembly and the stack paradigm feels like a Forth. The challenge is fun, though, and I'm filling in the gaps of my (unofficial) standard library as I go.

https://github.com/andrewarchi/ws-challenges
aarchi
·4 tahun yang lalu·discuss
To see if gojq works even with complex jq programs, I tested it on my wsjq[0] Whitespace language interpreter, which uses most of the advanced jq features. It impressively appears to support the full jq language, though I uncovered a bug[1] in gojq.

gojq's arbitrary-precision integer support will be useful (jq just uses 64-bit floating-point), though I suspect it will have performance regressions, since it uses math/big, instead of GMP.

[0]: https://github.com/andrewarchi/wsjq

[1]: https://github.com/itchyny/gojq/issues/186
aarchi
·4 tahun yang lalu·discuss
According to Guinness, the top is Voyager 2:

> The computer system that has been in continual operation for the longest period is the Computer Command System (CCS) onboard NASA's Voyager 2 spacecraft. This pair of interlinked computers have been in operation since the spacecraft's launch on 20 August 1977. As of 29 October 2020, the CCS has been running for 43 years 70 days.

https://www.guinnessworldrecords.com/world-records/635980-lo...