r/science • • 21m ago

Environment A 12-year genomic study of five deep-sea species in the Gulf of Mexico found that all had effective population sizes below long-term survival thresholds. Climate models predict worsening habitat conditions for most species, suggesting an overlooked biodiversity crisis in the deep ocean.

Thumbnail
nature.com
46 Upvotes

r/technology • • 27m ago

Security Congress Could Put Encrypted Messaging at Risk in Next Week’s Defense Vote

Thumbnail
eff.org
16 Upvotes

r/programming • • 36m ago

kav: a purely functional systems language with a small & fast compiler implemented in C

Thumbnail srcdump.net
4 Upvotes

i’ve been working on this for a while and i think im ready to show it off a bit :)

i started working on this project after getting excited by functional programming and type systems after learning some haskell, followed by some ATS. kav takes ideas from both but it’s also quite different. the language makes uses of linear and dependent types, compiled with functional purity, which is both safe and fun to program in. however, i won’t go into too much detail about the language design but more about the compiler implementation.

the compiler is fairly compact (about 6000 lines, although liens aren’t everything it gives you a ballpark idea of the scale) and implemented in portable C11, using bidirectional type checking and a small fourier-motzkin solver for proving index constraints. it uses QBE as the backend, which is also fairly compact and implemented in C. this makes the compiler pretty fast, and easy to bootstrap even from one of the more primitive C compilers.

the lexer is generated using re2c, but most of the actual re2c regex is generated using an X-macro of the list of tokens, which makes it very easy to add new keywords to the language.

the languages runtime is also tiny and not dependent on libc or a C compiler, which means the binaries are tiny and linking is quick. it uses a small bump allocator with free-lists for allocation. this is written in C, and ten compiled to qbe using the cproc C compiler. then that generated qbe code is linked into every binary as the runtime allocator.

the compiler is very fast, it takes about 30ms on my machine to compile a fairly substantial amount of kav code (most of that is qbe/assembler/linker which are out of my control, the frontend only takes a few ms)

there is also a standard library, which is not finished, but has enough to write some fun programs (i’m working on a posix make implementation)

i’m pretty excited about this and i’d love more people to get involved or just to try it out.


r/science • • 37m ago

Neuroscience A prion strain is not a single shape but an ensemble of differently folded protein fibrils. When a hamster prion was passed into mice, it evolved entirely new folds yet kept a molecular "fingerprint" of the original, letting scientists trace its evolution across the species barrier by cryo-EM.

Thumbnail
ucl.ac.uk
53 Upvotes

r/technology • • 1h ago

Artificial Intelligence Exclusive: The NSA's secret scramble to slow down AI

Thumbnail
axios.com
45 Upvotes

r/technology • • 1h ago

Artificial Intelligence Chinese police find AI training data problems at over 60% of firms inspected

Thumbnail
globaltimes.cn
34 Upvotes