HN user

manucorporat

393 karma
Posts28
Comments47
View on HN
manualmeida.dev 16d ago

NoiseLang: Where N = 5 is a Dirac delta

manucorporat
118pts53
manualmeida.dev 21d ago

Building Gin: Simple over Easy

manucorporat
64pts24
noiselang.com 26d ago

Show HN: Noise Lang, JIT stochastic programming language in Rust

manucorporat
2pts1
twitter.com 3y ago

Closure Extraction – mixing server and client JavaScript

manucorporat
1pts0
promptle.art 3y ago

Promptle – Wordle and Stable Diffusion

manucorporat
1pts0
set.health 6y ago

Show HN: Set.health – Mapbox for Medical Products

manucorporat
7pts0
news.ycombinator.com 6y ago

Ask HN: Leave job in covid19-times to start new business

manucorporat
1pts2
blog.ionicframework.com 7y ago

Ionic Framework 4.0 is out

manucorporat
61pts5
blog.ionic.io 9y ago

WKWebView in ionic

manucorporat
1pts0
blog.ionic.io 10y ago

Ionic 2 beta 10 is live

manucorporat
1pts0
www.martinhajek.com 10y ago

Macbook meets OLED

manucorporat
2pts0
tip.golang.org 10y ago

Go 1.7 Release Notes DRAFT

manucorporat
3pts0
github.com 10y ago

Show HN: Harvard CPU in Verilog and Assembler in Go

manucorporat
4pts0
github.com 11y ago

Go HTTP routing benchmark. Round 2

manucorporat
1pts1
sse.getgin.io 11y ago

Show HN: Realtime Server-Sent Events in Go

manucorporat
118pts37
www.independent.co.uk 11y ago

Airbus A320 crash: German Wings flight 'down in southern France'

manucorporat
11pts0
github.com 11y ago

Show HN: Reference asset files in Go easier

manucorporat
7pts0
www.youtube.com 11y ago

Miniature W-32 Engine

manucorporat
2pts0
smallpdf.com 11y ago

Smallpdf – Unlock/merge/compress/convert PDFs

manucorporat
3pts0
www.infoworld.com 11y ago

Delorean: Microsoft skips Windows 9, jumps to Windows 10 (2013)

manucorporat
4pts0
alcion-uxui.tumblr.com 11y ago

What If Apple Watch Was Round

manucorporat
2pts1
github.com 11y ago

Show HN: Visual Electric Field Simulation in GLSL (GPU Only)

manucorporat
4pts0
www.youtube.com 11y ago

The man behind the smallest V-12 engine

manucorporat
2pts0
www.gitlive.net 11y ago

Git Live – GitHub interactions in realtime

manucorporat
3pts0
github.com 11y ago

Show HN: Try/Catch/Finally experiment in Go

manucorporat
29pts11
gobuild.io 12y ago

Show HN: Gobuild.io – Godoc on steroids

manucorporat
2pts2
github.com 12y ago

Show HN: Go-nude – Nudity detection with Go

manucorporat
16pts3
gin-gonic.github.io 12y ago

Show HN: Gin – Golang Martini-like web framework

manucorporat
75pts29

the language can do a lot of very expressive things, every language feature works in your favor too, but agree with you, i would not use my own language for anything production.

like this:

D ~ unif_int(1, 6); Print("P(rolled a 6 | rolled > 3) =", P(D == 6 | D > 3));

or:

loss ~ unif(0, 1000); claim = if loss > 200 { loss - 200 } else { 0 }; p = P(claim > 0); Print("P(insurer pays a claim) =", p)

notice that "claim" is also a random variable! result of a if expression

Claude Max Plan honestly is kind of endless, I have a old game written in MRC Objectice-C that i am porting to something more modern, and still within the limits of the flat subscription... not sure for how long this will last

I was exploring ways to speed up this language, the naive implementation is just a interpreter executed in rust, which can just do so much. Once thing i explored was to compile the program graph into WASM, then execute WASM. The idea is the the WASM runtime would JIT program and run faster than any interpreter I could write myself. During this exploration, i found that I could use the JIT optimizer directly and skip the WASM step.

What noiselang does it parse, convert to a execution graph then carefully use the Cranelift api to describe the program, and under the hood, it will find different opetimization and generate byte code that runs directly in the host CPU.

The reason for it to be killer is that it allows NoiseLang to run as native speeds, with very little compiler/optimization work. it's a very simple repo.

For the RNG, this was a discovery myself, when profiling, i found the many benchmarks were limited by the speed of the RNG itself, ie, if i could genenrate random numbers faster, the simulation would be faster. xoshiro's next number is computed from its current state. So to get number N+1 you must have finished number N. It's a chain: A → B → C → D. Your CPU can run maybe 6 integer operations per cycle, but a chain only ever offers it one to run. Five of the six lanes sit empty.

I tried to use SIMD to speed this up, but still hit the limit, even if using SIMD, it still had to wait for the next number, a massive speed up came from realizing that i can keep four independent xoshiro256++ states and emits four samples per loop iteration, i += 4. Since the four state-update chains share no registers, the out-of-order core issues them in the same cycles instead of stalling on one serial chain.

SIMD gives you more work per instruction. But I wasn't short on work, I was waiting. A 2-wide xoshiro still needs state N before it can compute state N+1, so the chain is the same length and I wait at every link, I just get two numbers per link instead of one.

And each link costs more. xoshiro rotates a 64-bit word every round, and NEON has no 64-bit rotate, so that becomes three instructions instead of one. Twice the numbers, three times the wait.

Four streams wins because it leaves the chain alone. It just runs four of them at once, and the CPU was already idle enough to overlap them for free.

Yes, a Dirac delta is just "all the weight on one point", and that works fine on a die.

For the scope of the language it never even comes up, because Noise is a simulator, it does not evaluate densities, it draws samples.

The point is that every value goes through the same operators. Add them, compare them, pass them to a function, put one in the condition of an if. You can even use a random variable to define another random variable:

bias ~ unif(0, 1) flips ~[10] bernoulli(bias) // bernoulli just took a distribution where a number normally goes.

and in if-stataments:

DistributionC = if DistributionA < DistributionB { 0 } else { 1 }

But you right, dirac only applies to continuous functions, in Noise is only refers to the dirac measure. I found this article a fun/nerd to make my point that everything "acts" as a distribution from the DX perspective, but under the hood 5 is just 5.

And a constant collapses back to a plain integer in the graph anyway, so 5 costs nothing.

I know haha I wanted to be transparent about this, I have been coding since 9 years old, 32 years old now. I have nothing to prove other than it would have been impossible for me find time to complete this project without help, also a Toy language. Not trying to replace anything people use today :) it's a cute project

oh! that is very interesting. I was not aware of I could simulate markov chains with Approximate Bayesian, I have some good reading to do this weekend! indeed, expressions like P(D == 8 | D > 3) are already natively supported: https://noiselang.com/play/#x=conditional_bayes

Fair! My thinking was that PM of a single tone signal (the one i use in the demo is equivalent to FM, but shifted a bit). And implementing real FM for decoding is a lot more noisy, but I will add some callout in the article.

Truth be told, you motivated me to write the exact FM with the differenciation, maybe. Could be interesting to simulate PM vs FM for non single tone signals, to see how FM does even better!

I started this about 9 years ago and never finished it. The idea comes from a course in my telecom degree called "Señales Aleatorias y Ruido" (Random Signals and Noise), I spent so many evenings writing probability by hand, and every time I wanted to check a result with a computer it was a ton of boilerplate.

The engine is Rust, the JIT is built on Cranelift, there is also a WASM backend so everything runs in the browser too.

Full disclosure, I could only finish it now because of AI agents. In my experience they are amazing at the runtime and the numerical code, but pretty bad at language design, so I kept that part for myself.

It's a toy language. Ask me anything!

thanks for the feedback! while i wrote all the story myself I let AI do a full rewrite, i have not developed the eye to do the editing yet

Truth be told, I came up with this name when I was 12 years younger. The other big framework back then was called Martini. And Gin pretended to be the idiomatic version for Go. Go -> Gin

I have talked with couple of companies, and they are willing to pay, I would say there are good chances this could work, now the question is, even if you validated the idea, would you wait and see what happens with the current crisis? or you would just do it?

That's my dilemma:)

No, Stencil.js is like a "real stencil", it is used to produce something, but it is not in the final product.

There is nothing like "window.stencil" or any stencil related API in the output of the stencil compiler. It generates vanilla JS web components without dependencies.

The documentation of stencil linked in this HN post was in fact created with stencil itself. Just open the Dev Tools!

Here an engineer at Ionic. You don't need to integrate typescript to use a "widget" generated with Stencil. Stencil is a compiler that generates vanilla web components in javascript. You can just import the generated .js and use the component just like a "button" or native "input".

cool! why and how are the Go methods called with camelcase names?

  var engine = gin.default();
  engine.get("/back", CandyJS.proxy(function(ctx) {
    var future = time.date(2015, 10, 21, 4, 29 ,0, 0, time.UTC);
    var now = time.now();

    ctx.json(200, {
      future: future.string(),
      now: now.string(),
      nsecs: future.sub(now)
    });
  }));