News for hackers. Stuff that matters.

vasyop

Re:RawJS is a better way to call document.createElement() on Saturday January 06, 2024 @06:12AM (#38890444)
I think the main reason why small things like rawJS are appealing is that a lot of devs got directly or indirectly forced into learning a framework and then got themselves burned one way or another while using it. We then developed a shared fantasy: "What if the native browser API was good enough so that we don't have to learn any fluff (frameworks, build tools, libs) to be productive? After all, other languages don't have this framework bloat problem. Let's just use this minimal lib instead."

But this is just a fantasy. Element constructions are not the problem. Updating the state and DOM is the issue. We don't do stuff like rawJS or jQuery for bigger apps because they are too low-level and they don't scale well. What we need is to operate at a higher level, not get rid of almost all of the abstractions entirely like rawJS. Have a look at https://github.com/squaresapp/rawjs-sample/blob/35939695dba6.... This is the kind of code that is meaningless to my app. It's just DOM housekeeping. The example app is small enough so that there isn't much of it: this is the only interactive bit of your demo app. But the bigger the app, the more housekeeping like this you need. Try to showcase a bigger demo app with a lot of interaction.

Now, there are specific cases where I don't want/need a framework. If I want better performance, the framework can become a hindrance (this is generally the case - when you want performance, you need to look at the lower levels). If the app is tiny, frameworks are just fluff. But for the overwhelming majority of cases (apps that are not tiny and don't need amazing performance):

As a web dev, I want to assign some object to some reference and then my app to be updated based on my state. When some event happens, I want to update some of the app state. That's it! I don't want to mix my business logic with DOM fluff. I don't need another piece of code to worry about. I want some dependency to do that for me. Is it going to happen via virtual DOM or change detection or something else? Who knows.

Learn C and its lower levels interactively, in the browser – Part 3

I have release part 3 of my interactive C tutorial: https://vasyop.github.io/miniC-hosting/?2More info in my original HN post: https://news.ycombinator.com/item?id=19126544Get notified when I release new parts: https://github.us20.list-manage.com/subscribe/post?u=2790571880963241ec5dd7d11&id=0e2d1b34deI have also started a blog post series on how the project got to where it is now:...

( Read More... | no comments | 4 points | on HN )

Learn C and its lower level interactively, in the browser (part 2)

Hi everyone,Today, I have just released part 2 of my tutorial series.If you don't know what I am talking about, check out my last post here: https://www.reddit.com/r/javascript/comments/aoskao/learn_c_and_its_lower_level_interactively_in_your/.Get notified : https://docs.google.com/forms/d/e/1FAIpQLSectFtg9jl4zkFZqPnQkSRChNG7-I0qzR3247NRzdmAqEHCZA/viewform when new parts are released.Join the...

( Read More... | no comments | 2 points | on HN )
there is new

Show HN: Learn C and its lower levels interactively, in the browser

I made a simple virtual machine that runs C in the browser.This project is made as an experiment to see if C can be learned easier if the lower level is covered in paralel.Sandbox: https://vasyop.github.io/miniC-hostingTutorial part 1: https://vasyop.github.io/miniC-hosting/?0More info: https://github.com/vasyop/miniC-hosting/blob/master/README.mdPlease support this project:...

( Read More... | 33 comments | 356 points | on HN )

I've made an interpreted language on top of JS, tailored for beginners

I've made a tiny interpreted language on top of JS, together with an debugger, heap vizualizer and editor with common IDE shortcuts ( prettification, go to definition...).Github:https://github.com/vasyop/monoDemo (try step over):https://vasyop.github.io/mono/It's basically a simplified C with a single data type: int, and it's made to teach fundamental concepts with people with 0 programming...

( Read More... | 3 comments | 5 points | on HN )