HN user

kbr

798 karma

https://kabir.sh

Posts42
Comments146
View on HN
designmanifestos.org 3y ago

Design Manifestos

kbr
2pts0
youtu.be 5y ago

Nineteen Eighty-Fortnite: Epic's Video Response to Apple

kbr
5pts1
parenting.stackexchange.com 5y ago

Limit kids' screen time while I benefitted from “no limit” as a child

kbr
1pts1
blog.kabir.sh 6y ago

Optimal Virtual DOM

kbr
2pts0
kbrsh.github.io 6y ago

Purely functional web UI library

kbr
2pts0
blog.kabir.sh 6y ago

Monads Explained by a 15-year-old

kbr
3pts0
blog.kabir.sh 6y ago

Inventing Monads

kbr
3pts0
en.wikipedia.org 7y ago

Martian Packets

kbr
2pts0
www.reddit.com 7y ago

Nobody talks about the real reason to use tabs over spaces

kbr
122pts93
kbrsh.github.io 7y ago

Show HN: Moon – 3kb JavaScript UI compiler

kbr
71pts50
kbrsh.github.io 8y ago

Moon v1 beta – the minimal and fast UI compiler

kbr
6pts1
twitter.com 8y ago

Show HN: Ice – procedural art generator using random equations and noise

kbr
5pts0
blog.kabir.ml 8y ago

Mapping a range of numbers onto another

kbr
1pts0
blog.kabir.ml 8y ago

The math and algorithms behind a search library

kbr
202pts24
blog.kabir.ml 8y ago

Template Optimization: Moon vs. Vue

kbr
7pts0
blog.kabir.ml 8y ago

Identifying Product Ideas

kbr
6pts0
github.com 8y ago

Show HN: Moon – fast 7k Vue alternative

kbr
268pts192
blog.kabir.ml 9y ago

Inside Wade, a 1kb search library

kbr
88pts29
github.com 9y ago

Show HN: Moon – a tiny UI library inspired by Vue

kbr
11pts6
github.com 9y ago

Show HN: Wade – fast 1kb JavaScript search library

kbr
3pts0
moonjs.ga 9y ago

Show HN: Moon – a tiny 6kb Javascript library inspired by Vue.js

kbr
31pts13
medium.com 9y ago

Show HN: Moon – a blazing fast, tiny UI library inspired by Vue

kbr
9pts0
blog.kabir.ml 9y ago

Centering in CSS

kbr
3pts0
alter.cf 9y ago

Show HN: Alter – convert text/code to an image

kbr
76pts34
meetice.ml 9y ago

Show HN: An AI Twitter bot that can craft sentences

kbr
4pts0
meetice.ml 9y ago

Show HN: Ice – a bot that learns, and tweets about it

kbr
2pts0
github.com 9y ago

Show HN: Wing – A minimal, responsive CSS framework

kbr
26pts23
github.com 9y ago

Wing – A minimal, responsive CSS framework

kbr
3pts1
prisma-ai.com 9y ago

Prisma – turn photos and videos into art

kbr
1pts0
kingpixil.github.io 9y ago

Show HN: Lamp – a minimal lava lamp on the web

kbr
2pts0

NNs have complex non-convex loss functions that don't admit a closed-form solution. Even for small models, it can be shown that it's an NP-complete problem. In fact, even for linear regression (least squares), which has a closed-form solution, it can be computationally cheaper to run gradient descent since finding the closed form solution requires you to calculate and invert a large matrix (X^T X).

As a high schooler interested in things that are probably out of my league, I love reading this kind of stuff. The author mentions their unconventional style at the beginning: hyperlinks, color, italics, exclamations, parentheses, side notes, etc. They address your thoughts and craft their explanations around them instead of being terse and optimizing for length.

The author's blog [1] has more of this style and has really helped me get deeper into category theory. Without it, I wouldn't have even begun to try and understand things like the Yoneda lemma (which still remains a mystery to me).

Does anyone know any other papers or resources with this style? Maybe something like "explorable explanations" [2]?

[1] https://www.math3ma.com/

[2] https://explorabl.es/

I think dependent types are stronger than refinement types because they can encode types that don't necessarily have to be decidable. Refinement types are used for creating subsets of a type, while dependent types can be used for creating arbitrary types based on values. As a result, dependent types are more powerful, but they might be too much if all you need are some constraints on an existing type.

AFAIK React itself is performant enough, the bottleneck is client code within components. I suppose the change is mostly for full enterprise web apps at the Facebook level that likely have thousands of components running at the same time. Concurrent mode lets React split up work and give some time back to browsers (for e.g. mouse movements or rendering) to prevent large freezes on rerenders, essentially allowing prioritization of certain interactions for latency. On top of that, I think it also helps to remove some of the bottleneck that comes from I/O.

Yup, I think they definitely found the sweet spot for making revenue from games — offering players sweet returns if they keep playing (you buy the battle pass for 1000 vbucks, but you can earn back 1500 just from playing casually) while still keeping it relatively competitive and not "pay to win". They did host a $30 million world cup event after all :)

They pioneered the "battle pass" model for cosmetic items, and their constant release of skins, dances, etc can create a lot of recurring revenue I imagine.

Their semantics might be consistent, but they sort of leak into the parent. Height and width are local to what the component renders, and they don't depend on the parent (as long as they aren't relative sizes). But things like margin and align-self change how the parent renders all of its children.

In other words, the view rendered by the component is a function of properties like height and width. But when you throw in margin or align-self, the component now depends on its siblings.

The OO perspective is interesting — I agree that it effectively makes these things hard to express. I now think that it's more of a problem relating to encapsulation and isolation. OO would isolate it through a child component interface while FP would have a function that can't affect siblings.

How does it become any more object-oriented?

I saw it more as "purely functional", where components are the functions and styling outside of the component is a side-effect. Avoiding side-effects like margin or align-self makes components more like pure functions than objects IMO.

Inventing Monads 7 years ago

My bad then, that's fair. JS has been deviating from C-style syntax and it really shows in this article haha

Inventing Monads 7 years ago

Sorry about that haha, the style of programming in this guide is very different from C++, and it relies heavily on currying and lambda functions using next-generation JavaScript syntax. Nonetheless, I think it can offer a new perspective because JS is more comfortable than Haskell for most developers.

Inventing Monads 7 years ago

Thanks haha, I had exposure to computers from a very early age, and I try to make functions/systems representing things I'm curious about. It's helped me grasp ideas and come up with new ones, and I should probably write about them more :P

Inventing Monads 7 years ago

Hey! I attempted to make the code snippets use practical concepts, but they aren't very practical for use in actual JavaScript code — the reason being that JavaScript is not a functional language and doesn't have syntactic sugar for monads.

However, I chose JavaScript because I believe it's more familiar and widespread, and it can be easier to explain a foreign concept when it's done in a language that more people feel comfortable with.

Inventing Monads 7 years ago

Thank you! I'll mention "You Could Have Invented Monads" along with a couple of other great resources that helped me at the end of the post.

Glad you liked it. If you read some of the original Moon articles (“Introducing Moon”) you’ll find that I was frustrated with other libraries and strived to create a smaller and faster alternative.

Now I have worked on designing a new structure for web applications that I’m planning on writing further about. The view API of components in Moon closely models my vision for the future of the web. Moon’s philosophy is to have a consistent API in order to create views to display data.

For now, it is non-keyed. As I mentioned in some other comments I just wanted to get a beta out as I've been rewriting Moon for about a year and it's finally gotten to a semi-usable state.

A keyed implementation, single-file components (multi-file components exist with Moon CLI but I've started to like single-file components), custom DOM events, component inserts, and an official router are on my todo list. Hopefully you'll get to use the library this time :)

Your views are compiled down to JavaScript beforehand. Your example would be compiled to something like:

  m2.textContent = instance.text;
Use Moon.compile(template) to get a better idea of outputs.

It's definitely based on preference, but I designed MVL to be as simple and consistent as possible. For example, there are two ways to create a for loop (one on the ul and one on the li).

  <For={item in items}>
    <!-- multiple elements -->
  </For>

  <p For={item in items}><!-- single element --></p>
This syntax works for every component ("For" is just another component).

Thanks! It used to be a smaller version of Vue aiming to be a small subset of it. For the v1 beta (what the current documentation is for) I decided to change up the API to be something more simple that can still scale well for larger projects.

Linear types are different from immutable types. You can change the value of a linear type as long as you used the previous value somewhere else (for example i = i + 1). Languages like Rust leverage affine types (another substructural type system similar to linear type systems) in order to guarantee memory safety.