HNHacker News
TopNewBestAskShowJobs

s-p-n

14 karma · joined April 9, 2012

submissionscomments
s-p-n··on Free e-book (~2 MB): So You Think You Know C? [pdf]
I made it almost all the way through. I, however, died laughing at "... and vim is impossible to quit from"
s-p-n··on Free e-book (~2 MB): So You Think You Know C? [pdf]
I think every honest inexperienced C programmer would also get all the answers correct.
s-p-n··on Ask HN: How come my Ryzen 3750H is faster than my RTX 2060 in TensorFlow?
Yeah, I just finished installing the CUDA/tensorflow/python set on windows 10, and have the exact same results. So, it's not my configuration that's the problem.

Wow, this really brings to light how well Ryzen really performs. My nvidia 950m put shame to whatever intel i7 I had on my last laptop lol. Now I'm not even sure why I got a GPU on this rig

s-p-n··on HTML5 Sprite MMO First Test: Surface Tension
Thanks for the feedback, I think it's more valuable than it appears.

I'll fix this soon.

s-p-n··on DNS-over-HTTPS Update
Is this good or bad?
s-p-n··on Ask HN: Ideas for a Programming Language Book
Oh, it should be noted that I no longer needed an AST after rethinking my grammar approach. It was easy enough to just translate in-place. The best part, it wouldn't be too hard to change the output to AST, but I think my next step is to output an execution stream instead of a complete executable program. I'm currently considering the use of neural networks for error detection and suggested error-correction.
s-p-n··on Ask HN: Ideas for a Programming Language Book
While working on a language design over the last 6 years, I've created my own rules to achieve my own goals. I made a seemingly backwards switch from using an Abstract Syntax Tree, to a method of just simply lexing and replacing.

I find that it's very hard to write "good code" when writing a language. I also found that the Abstract Syntax Tree didn't help me write good code. It appeared to, but the biggest stride I made was when I took out that middle man and abstracted the grammar and lexer instead.

I would never have taken out the AST if it weren't for one problem: lexer state changes at compile time. Now, it's possible to do that with an AST.. But in my case, I couldn't go back to the lexer and change states after the AST was generated. I was specifically working on regular expressions, string interpolation, and XML Tags, and managing precedence for all these things (you gotta remember, greater than and less than tokens hate XML...). My biggest problem was that in each of those "sub-syntax" features, each sub-syntax needed the entire feature set and complexity of the rest of the language. I solved all that. String interpolation was the straw that broke my delicate parser's back. Before I knew it, despite my attempted use of "good practice", the token ambiguity problem became far too big to solve without modifying the lexer. And modifying the lexer was simply too hard, as many sub-systems managed each other, and I noticed I somehow created a very deep dependency hell despite my efforts.

Today, my grammar isn't perfect. I did, however, gain the ability to entangle the lexer with an API that tries to achieve loose coupling between rules, but the coupling problem is inherit to language design- the issue is ingrained in the algorithm.

See, writing grammars are very susceptible to tight coupling. I guess that's my whole point.

We should talk sometime.

s-p-n··on Is `let foo = () = foo;` good or bad?
Oh I read what letrec was, that is exactly the solution I was looking for! :)
s-p-n··on Is `let foo = () = foo;` good or bad?
Thanks! I'll look into let-rec, I've never heard of it before :)

Everything in my language is an expression, so I guess you could say every literal in the language is first-class.

I was thinking for i/o, I could use promises. The promise would resolve to whatever type makes sense for that resource- defined either by a library or by the program.

Of course, that brings up "arbitrary operations at runtime". My target after transpiling is JavaScript, which has a wonderful JIT compiler already. I need to learn source mapping and stuff so I can make error-tracing work nicely, as it's simply not possible to catch any possible error at compile-time.

s-p-n··on Exercises in Programming Style
I'm pretty much the same, been coding since 16 and I'm 28 now. I've gone through phases but I mostly code like the 2nd style. I mostly use JavaScript but occasionally pipe in another program (say python or C) when needed. I use new language features if it helps make things easier- ES6 has some really cool things, but I try not to let my code become cryptic. :)
s-p-n··on A picture got my PostgreSQL database to start mining Monero
I know! lol
s-p-n··on Ask HN: How "illegal" is the application I am building?
If you don't have access to a legal adviser at the moment, then at least give the copyright holders a way to contact you and ask to remove specific images of their property.