HNHacker News
TopNewBestAskShowJobs

smlckz

445 karma · joined February 24, 2020

submissionscomments
smlckz··on Ask HN: Where do I go to learn more about the lambda calculus?
Y combinator is a fixed-point combinator. [1]

[1] https://en.wikipedia.org/wiki/Fixed-point_combinator

smlckz··on Try these 4 languages from 4 corners of Programming
>> Currently the most popular lisp variant is Clojure.

Really?

smlckz··on Try these 4 languages from 4 corners of Programming
I think, C++ U OCaml ===> Rust.

Do you know about any language with as strong or stronger borrow checker than that of Rust?

smlckz··on Try these 4 languages from 4 corners of Programming
You should try Tcl.
smlckz··on Wren is a small, fast, class-based concurrent scripting language
https://wren.io/performance.html#why-is-wren-fast
smlckz··on Ask HN: If I only learn one static typed language, which one should I learn?
Why no one talking about OCaml?
smlckz··on Street-Fighting Mathematics
>> Not for sale on the Indian subcontinent.

huh?

smlckz··on Tiny C Compiler
They're using gitweb. You can read the code for any commit, just click the 'tree' link associated with it. Alternatively, just click the 'tree' link at the top for the tree of the latest commit in their default 'mob' branch.
smlckz··on Linking to text fragments in web pages
In a Chrome dominated browser market, how much choice do the other browsers have?
smlckz··on Ask HN: How do you print code?
No, now looked at the docs and saw that linenos does not work with rtf formatter. Sorry :(

(I didn't have to print line numbers back then)

You can generate LaTeX documents, images etc. with line numbers. And then print them. hmm.

https://pygments.org/docs/formatters/

https://pygments.org/docs/cmdline/

smlckz··on Ask HN: How do you print code?
We had a project work to submit C programs. Originally, the teacher told us to write the programs by hand. I had written ~20 C programs in my computer and was feeling lazy to write out all of them by hand onto paper. I then asked the teacher if I could submit the programs printed on paper and she said yes.

I was already using Pygments to highlight my source code and was thinking if I could print them highlighted with it.

Pygments has many formatters to format output. I used .rtf but you can also output images as well.

smlckz··on Ask HN: How do you print code?
I do not know how OP would be benefited from printing code, but I had to print my C code to submit as a school project.
smlckz··on Ask HN: How do you print code?

        $ mkdir rtfs
        $ for F in src/**.rs; do
        >     pygmentize -o rtfs/$(basename $F .rs).rtf -O linenos=1 $F
        > done
        
Now open the .rtf files with a word processor and print them.

To change the highlighting theme, e.g. to "pastie":

        $ pygmentize -O style=pastie,linenos=1 ....
smlckz··on Show HN: A simple GUI Notepad using C++ natively made in my high school in 2015
Nice.

>> I would now love to opensource the project for everyone.

Where is the license?

Learn more about licensing here: https://help.github.com/en/articles/licensing-a-repository

smlckz··on ‘Forever Chemicals’ Are Building Up in the Arctic–and Likely Worldwide
dead or broken link
smlckz··on Regular expression-a important tool for data science
fix the typoes in "Important Regular expression cheat sheet:"

    * 0 or more
    .
    .
    .
    [a-q] ...
    [A-Q] ...
    .
    .
    .
    [abc] ...
    [^abc] ...
that is, remove backslashes from the front of them
smlckz··on Lua 5.4 Reference Manual
Especially interested in variable name attributes [1] ('const' and 'close') as well as to-be-closed variables. [2]

[1]: https://www.lua.org/work/doc/manual.html#3.3.7 [2]: https://www.lua.org/work/doc/manual.html#3.3.8

smlckz··on Lit: A ridiculously small responsive CSS framework

        .\31{width:5%}
        .\33{width:22%}
        .\34{width:30%}
        .\35{width:40%}
        .\32{width:15%}
huh? can you tell me what those \31 \33 etc. mean?
smlckz··on Ask HN: Why FB Messenger video still on (green light), when off in UI?
hmm. when reading, /dev/null behaves like an empty file but /dev/zero gives you endless amounts of NUL bytes ('\0') ; iirc and the /dev/random and /dev/urandom gives you endless amounts of random bytes, but there is a subtle difference between those random sources.
smlckz··on Ask HN: Why FB Messenger video still on (green light), when off in UI?
>> Basically piping from /dev/null

Can you actually do that?

Why not piping from /dev/zero , heck even /dev/random or /dev/urandom ?

smlckz··on Ask HN: Why FB Messenger video still on (green light), when off in UI?
haha. what about microphones?
smlckz··on Show HN: A compiler for a small language into x86-64 assembly
You can try FASM (http://flatassembler.net) besides YASM and ld.
smlckz··on Ask HN: What can I build for you?
Programming language

* self compiling compiler (self-hosting?).

* self interpreter interpreter (metacircular evaluator)

[from scratch. no parser generator or backends like LLVM, or tools like that, as they hide much info and insight]

Testing

* Fuzzer (for testing, e.g. programming language implementation)

smlckz··on Free will under threat: humans are at risk of becoming wards of technologists
Are we Turing machines? :|
smlckz··on Eloquent JavaScript 3rd Edition (2018)
Ah! Good old C.

I did not dare to open the gcc man page, now I think I will look at it.

For that constraint, one have to pass an option. I want to know if any language (other than V) which has this as default.

smlckz··on 0.999...= 1
ah, Mathologer video.

Have seen that.

Another one by 3b1b on that topic: https://youtube.com/watch?v=sD0NjbwqlYw

smlckz··on Eloquent JavaScript 3rd Edition (2018)
>> In design - not just programming language design - constraints are generally a good thing.

The best example of that in programming language design I have seen is the V programming language. (https://vlang.io)

No global variables, no null/undefined/nil/None/... V is the only language I know in which variable shadowing is an error. (Do you know any other language with this feature/constraint?)

And then I remember the handling of ''var''s in js and hoisting etc. ... sigh!

smlckz··on 0.999...= 1
Reminds me of the paradoxes of Zeno [1], especially the paradox of Achilles and the tortoise.

At least one can simply prove that 0.999... = 1 without much hard work. Maybe less controversial than the following:

    1 + 2 + 3 + ... [somehow] = -1/12 {{Riemann's zeta(-1)?}}
    1 + 2 + 4 + 8 + 16 + ... [somehow] = -1
As well as the weird prime product (Product of 1/(1-(p^-2)) for p prime) and the sum of x^-2 from x=1 to [sigh] being equal to (pi^2)/6 are some example of infinite beauty of mathematics that I remember.

[1]: https://en.wikipedia.org/wiki/Zeno's_paradoxes

smlckz··on Eloquent JavaScript 3rd Edition (2018)
Read the accepted answer to this question: https://stackoverflow.com/questions/2800964/benefits-of-prot...
smlckz··on Eloquent JavaScript 3rd Edition (2018)
JavaScript is very expressive and powerful language. Maybe hard to learn. The prototypal inheritence and 'this' were confusing to me and took much time to understand those.

Then I learnt that prototypal inheritance is a superset of ''class''ical inheritance [1] as well as this [2]. Hmm.

With Reflect, Proxy etc. you have great metaprogramming capabilities that make this language much powerful.

Still, there are some (many?) edge/corner cases and unfixable bugs (aka features) that the language is stuck with for the sake of backwards compatibility and developers have to learn these. (The most famous of these might be typeof null === "object")

When I look at the amount of features added to the language specification, sometimes it seems like it is going to become another incarnation of the C++ specification.

I still like its expressiveness and power, but if it becomes another C++ in future, I have to look somewhere else. (TypeScript maybe.)

[1]: https://aaditmshah.github.io/why-prototypal-inheritance-matt... [2]: https://wiki.c2.com/?ClosuresAndObjectsAreEquivalent and https://www.crockford.com/javascript/private.html

← PreviousPage 5 of 6Next →