330 points · by PKop · 6y ago · 131 comments
I’ve been working on a side-project, that allows recording and playing back interactive, guided walkthroughs of a codebase. This seems like an excellent “test case“ for that experience, which I might have to experiment with :)
Now, I am looking at Flutter. Seems to match my needs, and it's also actively maintained.
Never underestimate the power of proper tooling and abundance of documentation, better be productive rather than cool.
So Flutter Web is pretty nice if you're not making a forum for example but moreso any type of CRUD or business app where text is not a big factor. Of course, since it's Flutter you can then build mobile and desktop apps as well from your application for those who want more control.
I just wish they could support more languages and tool chains, and I wish an IDEA subscription entitled you to all other versions of the editor. I want to buy one but use Webstorm because it’s a little less resource intensive than IDEA. And I want them to make like five more IDEs, which I feel they could fund through IDEA-specific revenue.
They do offer that; it's called the All Tools subscription. It costs more than the IntelliJ subscription, but you get all the IDEs, ReSharper, etc.
He was already a great developer when he started Rollup, but writing it brought him to a new level.
Rollup is super clever: most bundlers back then would treat JS modules like giant strings and concatenate them. It was just plain string concatenation, similar to require.js's "define()", so you needed a runtimes that answered to "require()". Modules were assembled during runtime. [1]
Rollup, instead, uses an algorithm to transform the AST of multiple modules into a single AST, inlining all modules and turning them into variables [2], and renaming duplicate identifiers. The final code looks like something that a human would do if asked to put everything in a single file. [3]
This is done by manipulating the AST returned by the Acorn parser, something he seems to have become an expert on.
I'm pretty sure that it was during the development of Rollup that he had other ideas for crazy optimizations, but unable to apply them to a Bundler, he created Svelte.
--
[1] https://requirejs.org/docs/api.html#deffunc
[2] https://github.com/rollup/rollup/blob/1e1a11107dbee11636dcf9... and https://github.com/rollup/rollup/blob/1e1a11107dbee11636dcf9...
[3] https://risanb.com/posts/bundling-your-javascript-library-wi...
If you look at the Svelte repo, the project didn't appear overnight. The first commit dates to 2016, and since then there have been many contributers. Don't think Harris solely built the project to where it's been. He's had help.
Lots of under-recognised talent is eveywhere.
- track people and systematically destroy privacy forever
- trick kids into clicks via what should be illegal recommendation algorithms
- use their insanely talented minds to work in advertising
Need more diversity in tech. This should be encouraged vs gulping down the big fat framework FB tells you to
In a field that goes hand-in-hand with programming, which includes pretty much every artistic one, it shouldn't be all that surprising that people know how to use/are at least curious enough to learn the tools available to them.
There are Lisps that are almost universally seen to be great. There are absolutely terrible Lisps as well.
Are there any TypeScript reactive frameworks? I know you can use TS with the others, but finding tutorials can be a pain since it all these are JS first frameworks.
I'm basically trying to do a superset of typescript where you create elements so:
const root = c({
el: 'div',
children: [
`hello, ${store.user.name}`
],
attr: {
class: 'bold smart',
id: 'abc',
bla: true,
},
evts: {
click: () => {
console.log("Clicked")
}
}
});
And store store.user.name is "magically" reactive.Was that what you meant?
For reference, in Svelte that’d be something like this, which is shorter and more obvious:
<div class="bold smart" id="abc" bla={true} on:click={() => { console.log("Clicked") }>
hello, {store.user.name}
</div>This is very early stages and completely experimental.
The idea I'm experimenting is to compile typescript to another form, I completely see your point about too verbose though, but I'm also toying around with jsx.
Basically what I'm trying to do is a svelte where instead of this:
{#each cats as { id, name }, i}
<li>
<a target="_blank" href="https://www.youtube.com/watch?v={id}">
{i + 1}: {name}
</a>
</li>
{/each}
You have have the native JavaScript map functions and so on.Again, this is completely in the early stages and just playing around until something feels right.
Any recommendations appreciated.
There are TypeScript plugins to statically analyze the templates, like lit-analyzer and the lit-plugin VS Code extension.
LitElement provides TypeScript decorators for declaring reactive properties and more.
TypeScript doesn't in general change its emit based on types, so its runtime feature set is exactly the same as JavaScript.
lit-html has a TypeScript compiler plug-in which provides template type=-checking, and LitElement provides decorators, like I said. How would something be more aimed at TypeScript, and not JavaScript?
I've also used Elm for another little side project, and it was super fun to learn, but it was a bit mind-bending at first.
I think Svelte is a fairly safe choice because it's actively developed and because it's not too different from Angular/React/Vue.
If there's any possibility that you'll have to hand this code over to someone else, I think Elm is a much less safe choice.
So, to echo tomerbd's reply: Elm for fun; Svelte for profit.
I haven't used Elm yet.
Svelte seems great, but it seems to be developed by one person primarily. Also, that person lives in NY and the project looks paused at the moment.
I'm currently writing a blog about trying as many front end frameworks/languages as I can. I'm going with this approach because I want to see what I can learn from each of them. For example, I've learned from Elm that compilers can be much friendlier. I've learned from Svelte that people are more willing to accept what appears to be familiar.
You may learn something completely different.
I've not used Elm so maybe that is better. React has good support for type checking. I would use that.
I'd say it depends on your teams skill set and level of disciple. The best defence against a buggy codebase isn't a programming language or framework, its good all fashioned discipline.
"Just don't write bugs", "just write perfect code", etc
Given that you and your team has all the discipline you need, you could still argue that type checking the codebase in your head is time consuming and is better spent on higher level concepts.
A typesystem can get in the way and slow down development if it's too strict of course, but I feel typescript does a good job of keeping it optional enough.
There is no clear answer here, but at least refactoring is much easier and safer given that your types are sound.
Navigating through code, refactoring, or simply figuring out what to pass as function input can become a challenge in the absence of types.
It is still worthwhile imo to have something that catches mistakes even great people make.
Though evancz now works at NoRedInk. https://www.noredink.com/about/team
Direct DOM interactions are faster and you don't have to bring a whole VDOM library.
You can in fact see how it works by looking at the output. Go to the REPL at https://svelte.dev/repl/hello-world and select “JS output”.
Can we bring this ideas to react and Vdom based frameworks? I imagine Babel/typescript can analyze jsx to find which attribute are bound to a variable and which are just static. The static ones don’t need to be diffed, only the dynamic ones.
I stay away from magic templates compiled at runtime. I've been bitten way too many times. Plus it's not good for load performance when you have to ship a string compiler with your code.
We use lit-html in thousands of components at Google with very strict type-checking and linting. You simply aren't allowed to miss an end tag, or bind to a non-existent attribute or property. The performance and code size are excellent, beating every major framework including those using compilers. The "compiler" we use is simply the HTML <template> element and a tree-walk. It's very, very fast and very, very small.
https://blog.vjeux.com/2020/uncategorized/reflections-on-exc...