(upbeat music)
♪ Welcome to Svelte Radio ♪
- Welcome everyone to another episode of Svelte Radio.
We are back after a hiatus.
This is usually how it goes nowadays.
We don't record as often as we would like.
But we are back, as I said,
and today I have a guest.
It's Julian Burgess.
Did I get it right? - That's it, that's it.
- That's it, all right, cool, cool.
So Julian, you are a long time Svelte veteran,
or so I understand it to be, at least.
Maybe tell us, well, what's your story?
What do you do, maybe first off?
- Yeah, so I kind of work at,
no, I currently work at,
well, I've been working at Bloomberg now for over 10 years,
and I'm in their graphics team
on the sort of engineering side.
And so that's a mix of kind of like looking after
extremely full stack,
where it's kind of like looking after the servers,
figuring out sometimes sort of DNS and CDN issues,
and then also actually working on the graphics themselves
and sort of the data pipelines and things like that.
And so with that, I've been using Svelte for a long time.
I think since version two,
which I think is sort of almost technically the beginning,
because I think version one was sort of,
Rich kind of threw it in the bin almost
as soon as it was ready and sort of like,
was like straight onto version two.
And it was funny actually,
'cause I almost worked with Rich as well.
It was a bit of a sort of regret
or sort of sad thing in my mind,
in that Rich was working at the Guardian and was trying--
- Here in London?
- Oh yes, he was in the London office
and was transferring to the New York office.
And so we were chatting a bit about that.
And yeah, and so then I got the job at Bloomberg.
And so I left not long after, just before he arrived.
But he came along to my house warming actually.
I just moved flat at a similar time.
And so that was the first time I met him.
And yeah, he's a--
- So you go way back then.
- Yeah, so he's a really nice, warm, lovely person.
And I suppose from that I then started looking
at some of his projects.
And I was saying earlier, I think,
I used Gobble and I can't even,
I should have looked up what it was.
I can't remember what it even did.
(laughing)
- We'll have to ask Rich.
- Yeah, and there was Splunk, which--
- That's an odd name.
- Yeah, well you know this Splunking
is where you kind of go down into a cave?
- Yeah.
- And so we actually still use that at work
where it's a kind of, the way it was,
we have a modified version of it.
But it kind of, it just sort of goes into a folder
and just any files, so sort of text
or sort of CSV or JSON or anything it sort of finds,
it will kind of append it onto a tree
so that you can then sort of use that quite easily
within your code.
Because we're using that within a build step,
so it doesn't really matter.
Or it may not matter about the file size in memory
at the time when you're doing the build.
The output of the build still matters.
But it's kind of nice things where it's nice
to just make the, you don't have to worry
about loading files, it's just done for you.
And I think I played around a tiny bit with Rective,
but never used it.
And then--
- So Rective is like the predecessor of Svelte.
- Yeah.
- One could say, I think.
- And then so I think Rich made the announcement about Svelte
and I was like, this sounds good.
- And this is Svelte 2 we're talking about.
- Yeah, I see.
And so I tried it out.
And I think, I'm gonna have to double check,
it was either the UK election for 2015 or 2017.
I can't remember which year it was.
'Cause we've had quite a few elections in the UK.
And yeah, the thing which was,
I mean, the thing that I think particularly was good
was the way that it was, which isn't necessarily,
now with the way SvelteKit works,
it's sort of different entry points into this.
But the way you could have multiple entry points,
because we wanted to make it
where there was the main graphic itself,
which shows the sort of overall results,
but then we wanted to extract out bits of it
to use on a widget for the homepage.
And so the homepage gets a lot, lot, lot more traffic
than anything else.
And so trying to make it very small is of key importance.
And I can't remember how it was really impressively small,
like, you know, 14K or something like that
of the total code that we had.
And I think we managed to get the data down to like one,
you know, under 1K or something like that as well.
- Yeah, I mean, that's almost nothing.
- Yeah, exactly.
And so it was kind of, so, you know,
you're not sort of worrying about the sort of performance
here or things like that.
And it's just kind of grown really.
So now the whole team, I mean, the team has expanded a lot.
We're close to about 50 people, I think,
across sort of London and New York and in Asia as well.
And yeah, and I think that it's interesting as well,
because I mean, obviously React is so big.
And I looked at React, I've never really worked with it,
because well, we actually, before as well,
we used, one of our colleagues used Angular.
And so I could sort of see how good it was
in terms of like being able to make components.
But it also seemed like it would quite quickly
get into kind of crazy problems
with like how much rendering was going on.
- Right. - Yeah.
- Right, and that's not very nice
when you're doing like some interactive graph or...
- And it can be, yes, because it's,
particularly with graphics, when you're doing,
you're often doing a lot of stuff with SVG,
but you can have quite sort of big DOM trees
where there's sort of like hundreds or thousands
of sort of elements going on.
And so, yeah, trying to avoid unnecessary renderers
is important, and particularly as well
where you have sort of interaction.
So if it's sort of like some sort of mouse,
you don't want sort of a mouse over
to sort of like cause the whole tree to be re-rendered.
You just want sort of it's like the sub-tree
or whichever bit to do that.
- I'm guessing that makes you excited about Svelte 5?
- It does, but I think there's a lot of kind of uncertainty
and skepticism, because I think with that as well,
the thing which, again, was also a big attraction to me
was that Svelte looks a lot like HTML,
regular HTML with a script tag and a CSS.
- I assume in Svelte 2 it was even like HTML files,
if I remember correctly?
- Yes, I think you could put kind of any extension.
So I think we, but we did use .html, yeah, I think,
which was a bit confusing, perhaps.
But then, yeah, and you had to, it wasn't,
I think with Svelte 2,
we didn't have the dollar prefix as well.
You had to, I think you had to have a computed property
that you exported, and then each function
was the kind of like, well, this was the thing
that depends on something else.
And that--
- I mean, the documentation is actually still up.
- It's still up, okay, yeah.
- If you go to v2.svelte.w--
- Oh, nice.
- You get to the old v2 documentation.
I've just randomly, occasionally, just gone in there and--
- Just to check, yeah.
- Yeah, just to check, see how--
- Yeah, 'cause it feels weird, I think,
'cause I remember, in a way, I was like,
this dollar thing seems a bit crazy as well
when it first came out.
And I was like, oh no, this is broadly good.
I mean, I think it can be, well, I did that talk
at Svelte Summit as well, where I was sort of saying
how the, it's one of the things I see a bit with people,
'cause we have a variety of sort of levels of skill,
and it's sort of on the team,
but it is one of the things I see sometimes
where people just kind of dollar prefix almost everything.
- Yes, I've seen that as well.
- Yeah, and not necessarily, which isn't,
I'm not saying it's actually necessarily bad,
but you're kind of like, if you're kind of thinking,
is it possible for this value to sort of change
without it causing all of the things below it
to change as well, or is it, and it's like,
can that value, sort of, is it possible really
for it to be cached and reused?
And even if it is, is it sort of valuable as well?
Because it's kind of like,
if it's doing some kind of long thing,
and then the sort of, it comes out with a string,
that's great, maybe you're gonna hold onto that,
but it's usually not like that.
And so I feel like trying to put the logic
into a whole kind of block which sort of encapsulates
everything that's supposed to be going on at that point.
So particularly around things like sizing
and stuff like that, you know, where you're kind of,
so in a graphic, very often you'll be kind of,
we use D3 a lot as well,
sort of a JavaScript visualization library.
And so a very common pattern is you've got some data,
you loop over them to find the sort of,
the maximum sort of minimum value
to set the domain of the scale.
And then you're kind of doing some other things
with the scale based on the size of the window
and all of that kind of thing.
So all of that is a kind of,
usually a nice sort of concise block that should,
should go in a reactive block.
- Yeah, yeah, I find that, like,
when I've seen people use reactive blocks,
I try to avoid them, actually,
but then my use case is not a lot of interactive stuff, right?
- Right.
- I just use Svelkit, and then I use form actions
and the load function, and that's pretty much it.
- Right.
- Some tiny amounts of interactive stuff I do,
but, like, rarely stuff where things are, like,
moving around the screen, or I have to, like,
recalculate things and stuff.
Like, I usually just let the, let Svelkit handle,
like, the invalidation of the data,
and, like, updating it and stuff, so.
But I've seen, like, examples of people
overusing reactive statements, and I find it gets
very hairy very quickly if you have, like,
many blocks and many statements,
'cause you kind of don't understand, like,
how they trigger each other.
And also, a reactive statement,
if you put it in the script tag,
even if you put it above some other declaration,
it always gets instantiated last, I think,
if I remember correctly, so you have to also think about
the order in the script tag that you put things.
That's usually not a problem, but it's something I'm--
- No, I think that is, I guess it's true, yeah,
that people, it is also confusing as to,
with a reactive block on mount, and then just sort of
stuff that is directly in the script tag,
which exactly is gonna happen first.
And I'm not even certain I could say for sure without,
you know, my life depending on it.
But the, I mean, I think with that as well,
what we tend to do is that sort of common pattern,
particularly where things are arrays,
you just have an empty array, and you're like,
let me just, you know, so it sort of is
initially instantiated with that.
- Yeah. - And then,
you know, data is loaded, and then you've sort of set it,
and then it sort of triggers it again,
but it's only one render.
- Yeah. - And that seems to,
it seems to be sort of a pragmatic solution, yeah.
- Yeah, so you were talking about the Svelte 5,
and you were talking a bit about simplicity
of Svelte before, I think? - Yeah, I mean,
I was gonna say another thing as well,
is we were also early to using SAPA as well.
- Right.
- So we used that to make a number,
I think we did at least one or two elections,
and we also did the best business schools guide.
- Yeah, so SAPA, for those that don't know about it,
people that are new to Svelte,
SAPA is the predecessor to Svelte Kit.
- Yeah, and it was good, it was a lot better, I think,
than anything we could have done previously,
or would have been, it made things much simpler,
but relatively, Kit made things so much easier.
There were a lot of problems around page navigation
and exactly where events would occur,
and trying to squeeze in,
even when you got the page itself
roughly doing what you wanted,
there was complexities with things like tracking
and analytics and things like that,
where it has to know whether it happens
at the beginning of the page or the end,
and whether it still has the previous page's URL in it
and that kind of thing.
So I know almost, I think, all of those problems in Kit
just disappeared and was so much nicer as well.
It was just like, so yeah, Kit has been a huge improvement.
And yeah, so I'm excited about Svelte 5.
In fact, it was interesting,
'cause I did a lightning talk in London,
the Svelte meetup, quite some time ago now,
maybe two years ago.
- Svelte Kit's been out for a long time.
- Yeah, and this was around,
I guess it would, that wasn't the title of the talk,
but it was essentially around fine-grained reactivity,
which is now the hot buzzword with Svelte 5,
because there's the immutable tag in Svelte 4
and probably 3 as well, I think,
where you can say, if these objects are not mutated,
then it would just do simple checks,
which can eliminate renders that don't need to happen,
because at the moment, Svelte, by default, is pessimistic,
so it sort of assumes that you might have mutated the object.
And so there's a kind of little demo bit of that
in buried, well, not exactly buried,
but it's towards the sort of advanced,
sort of empty bits of the documentation and tutorials.
But it always sort of stuck in my mind of kind of like,
well, that'd be interesting if we could try
and sort of eliminate unnecessary renders.
Although I have to say as well, with that,
well, we'll probably talk about this more in a bit,
but I use Svelte quite a lot on my side projects,
and it's amazing actually how fast things are.
And I think it can also be that,
am I over-optimizing and worrying about eliminating renders,
and it's actually fine, you can still just do
thousands and thousands of things
and still get 60 frames per second, and it's no problem.
So I don't know, but it feels,
I think that there's also to some extent,
if things are definitely only rendering when they change,
it's also interesting because you can then
sometimes have sort of effects which sort of play on change.
And that itself can be a kind of a useful
kind of visual sort of UX kind of addition.
So I'm excited to see where that goes in Svelte 5,
but it does mean that, yeah, so basically,
I said to Rich about the talk and he was like,
oh, we don't bother about it,
'cause in Svelte 5 it completely eliminates it,
and I was like, okay.
But yes, I've only played around with Svelte 5 a bit
in my spare time,
'cause we're currently working on the US election for 2024,
and this year is definitely not a time to go
playing around with completely new technologies.
It's a much bigger team and it's more ambitious
as a graphic.
- I mean, it's been release candidate for how long now?
- Quite a long time. - Yeah, a very long time.
- I think as well, it's just conceptually,
'cause it has been, a few people talked about it,
where the dollar had this kind of nice
sort of simplicity to it.
And I think kind of state, derived seems okay.
I think, 'cause I feel already, I've read a lot
and watched quite a lot of videos where people were like,
be careful with effect, yeah, and it's like you kind of,
and I can see why it's problematic,
but I know at the same time I'm just gonna,
I'm definitely gonna stumble into those problems myself.
- Right, yeah, same, same.
- Yeah, I was actually interested as well.
There was a video, I've forgotten the name of the guy,
it's the guy who says easy peasy lemon squeezy.
- Ah, Matia, Joy of Code, I think.
- And that was a really helpful video,
but he was talking, I think it was about this animation
sort of library he had, and how he was--
- Animation? - Yeah, that's it.
And the fact that he was still actually using stores
as, with Svelte 5, and I didn't actually realize
that they were so compatible like that,
and I was like that actually looks very helpful.
Right, that's good, 'cause I do love my readable stores,
one of their sort of favorite things.
- Yeah, because one of the new features of Svelte 5
is the fact that you can extract those reactive statements,
as it were, to separate files, right?
So you can reuse the logic, you couldn't do that before
because reactive statements could only be read
by the compiler in the Svelte files, right?
So that's an interesting change, right?
So you could kind of move away from stores
into something like that, but then there,
I know some people are worried about interactivity
outside of Svelte, because if you use the,
like the rune style, so you have to basically create a file
that's named something.Svelte.JavaScript or .ts, right?
And that's where you put your logic,
and then you can use runes in there,
and everything is fine and et cetera,
but nothing outside of Svelte understands those things,
right, I think.
So in that sense, stores are still maybe an easier way
to interact with non-Svelte stuff.
I'm not sure, I haven't gone down that route.
- Well, I have found that sometimes with projects where,
'cause I think once you start to sort of think
reactively like that, you kind of often want that
with things, and so there was like this project,
well, I should maybe say about prefixing it,
in 2019 I did a master's degree at Goldsmiths
in computational arts, which was really fun and exciting,
and I did learn a bunch of things,
but it's still with that, it's like when you've got a tool
that just becomes your kind of like favorite tool,
and so I use Svelte for quite a lot of the projects
with that, and I still, I use Svelte in sort of artistic
kind of creative ways.
And so yeah, there was something like that where I was
controlling a whole load of servos, and it was basically
just have an array of like the positions you want to go to,
and I was like, well actually, it's because you would
sort of send this over the wire, and again,
it's one of those things where it's like you don't,
you don't necessarily have that much time to investigate
as to how these things work, but it's a very low bandwidth,
it's like 9,600 bits per second, and so you're kind of like,
well, I don't want to go send an unnecessary kind of move
to this position if it's still the existing position.
Exactly, and so I was like, well, I'll just ship it
through Svelte, I mean, I could as well, I could just write
my own kind of like array different kind of thing,
or maybe this is probably tools for that, but I was like,
well, I don't really have to think about it like this,
I'll be like, why not just, you know, it's available
on a webpage, but it is a bit strange sometimes
where you kind of have things, well, I don't know,
I kind of go back and forth, 'cause it's having something
that's completely kind of, there's sort of like headless,
but then there's also kind of like, and not even having
any sort of interface to it at all, so this is strange
in that it's kind of like actually the user interface
is doing the calculation, so it's like nothing happens
unless this webpage exists somewhere, and so a browser
has to be kind of like looking at it, so to speak,
but you're kind of like, well, it's not necessarily
a bad thing because it's kind of like just like a kind
of interface panel that sort of tells me what is the position
of these servos, and so, yeah, but it is a bit strange
'cause you kind of, you have to have something that can run
a browser somewhere, so yeah, I suppose in a more purest way
it would make sense if that wasn't happening.
- Right, yeah. - If it could just be
happening purely server-side.
- Yeah, all right, so you still like your stores.
- Yeah, still use stores. - You wanna keep them?
- Yeah.
- All right, so how do you use stores like at Bloomberg,
like generally, do you use it to like interact
with something like Three.js, or is that done without stores?
- We don't use Three.js tons, or at least I haven't,
particularly, I mean, it's every, I mean, essentially,
so I should sort of say in terms of like in the graphics
team, pretty much every, the way, 'cause I sort of look
after the back end of how we publish graphics,
and essentially the API of the graphic or the publishing
system is just that we have a public folder and we just
deploy that, and so all of the, well, there's an awful lot
of intelligence that has to go into the sort of build step
to make the graphic, and then otherwise, after that,
it's all on the front end, and so, wait, what was I
talking about?
- Stores. - Oh, stores, I see, yes.
So, again, Three.js, so it's kind of, so with that,
it's very open for people to try things out, so we don't,
if people want to, so if you're doing something with Three.js,
it might be that Svelte is not necessarily useful
as a sort of tool for handling this, or you know,
you might use Throat, which is still built on Svelte,
but it's kind of often to its own thing a bit.
Yeah, so I mean, I don't know, the main, I mean,
the classic things, stores are great for kind of
interaction where you're kind of, you know,
you're selecting some kind of data point,
and it's often, even if you're not,
I quite often would sort of advise people to be like,
it's a good way to use a store, even if,
'cause there's a lot of editing that goes into a graphic
as well, so you quite often will be like,
it starts off as one chart, and then we split it out
into three charts, and then it goes to two,
and then it goes back to one again, or something like that.
And so, it's kind of having that sort of flexibility
is quite important, because what you don't want
is where you're sort of, you know, the editor says,
oh, actually, I don't think we need this, and you're like,
oh, damn, why did I put all this work into it?
Well, you know, if you take that chart out,
then it breaks the interactivity of other things,
or something like that.
And so, yeah, having that kind of thing
where you're like, you're just sort of binding to a store,
which is like, I'm selecting this sort of value
on the X variables, or something like that,
and then you can just be like, across all of the graphics,
you then just take that value, and be like,
now, this is the selected one, is very useful.
- Do you know if it's common to write custom stores,
or is that something--
- Not that common.
- Just generally use the built-in lightable and readable?
- Yeah, it tends to be.
- 'Cause I kind of find the custom stores to be
a way of encapsulating some form of functionality
that could be anything, but--
- It seems a good idea, I mean, I think it's,
building something that is sort of so strong,
like, that does strongly encapsulate is sometimes tricky,
or to what extent, 'cause I think very often, as well,
there's quite a small number of people
that are actually working on a graphic,
and so a lot of that knowledge is in your head
about the sort of the structure.
- I assume, as well, if you're in the graphics department,
you don't have unlimited time getting things out.
You have kind of like, you have some deadlines,
and then once it's done, you don't really touch it again.
Maybe you go back and look at how you did something.
I'm just assuming.
- Sometimes things do, it varies.
Sometimes things do get updated.
We've got, we've made a push this year,
which is working quite well with,
to extract out reusable components.
But with that, as well, the sort of direction we've taken
is rather than trying to build the perfect component
where you just kind of like just use it
and it does everything, it's actually to try and build
a kind of a good sort of component,
but that we actually say, we set it up
so that you actually just copy it into your project,
because there's, I mean, sometimes you can do a component
that is just like, it does everything that it needs,
but with things like a table,
a table is so fiendishly complex.
There's like, there's no perfect table component.
And it's like, and the more you try,
all that happens is you just get a bigger and more complex
table component.
- Just gets more abstracted and like complicated.
- 'Cause there's always something you can do to a table
that will just make it incompatible
with other things you've done.
And so with that, it's more like,
here's a bunch of kind of like,
this is a way of doing a table like this,
and this is a way of doing it like that.
And particularly once you want to start
putting other components inside the table,
and then you're kind of like based on this,
this thing shows or doesn't, and all of that, yeah.
So that tends to be--
- I hadn't even thought about that as a use case
for like showing things on a, like--
- And also just 'cause it's,
I mean where you find this all the time in HTML,
just 'cause it's sort of table-shaped
doesn't mean that actually a table is the right
sort of underlying elements to use as well.
- Although the table element is kind of underused in HTML,
I would say.
- Oh, I don't know, maybe, yeah.
I mean, it's weird 'cause I'm so old school
that sort of, you know, there was, for years,
there was all that thing of like,
stop using tables for layout.
- Right. (laughs)
- Well, maybe that's why I feel like tables are underused
because people are like, oh, I've been taught
I should never use tables.
- Oh, that's true.
I think, yeah, there was that.
- So they just like, ooh.
- Yeah, yeah, people were like--
- They're quite nice.
- Yeah, no, I do like tables.
I mean, I think it's, I mean, it's to do with the way
the layout, I mean, I don't know how,
what the algorithm is inside,
but you realize it's really weird and complex
to be this sort of like get the biggest thing
that won't compress, and then--
- Right.
- So there's all these kind of complex,
cascading kind of effects on like the sizing for it.
Whereas, but I mean, it's also one of those things
where if you, I mean, well, if you're making big tables,
you know, hundreds of rows,
and it does get kind of weird and complex,
but I mean, if you're using it,
very often in the way we tend to use tables,
you just like, this column's always this width,
and things like that, so the render
and sort of layout performance is perfectly fine anyway.
- Yeah.
- But yeah, I was gonna say the other thing
we use readables for, I mean, particularly for the election,
is for sort of polling and for fetching data as well,
and that's also one of those things I'd like a lot,
that they're sort of lazily evaluated,
and it's funny how often I forget that as well.
It's like so many times when I'm doing it,
I'm like, "Why isn't this thing even working?"
And I'm like, "Oh, because I'm not subscribed to it."
- Right, yeah, yeah, yeah.
- So yeah, so I often build quite a lot of little
sort of test pages for myself as well,
which is now, again, so much easier with SvelteKit,
where you can just be like,
just check that this sort of thing,
this component is doing its thing,
and it will be sort of subscribing to that store
in the way I expect it, yeah.
- Yeah, I think the dollar sign prefix thing for stores,
it kinda tricks you in a way that you're not using a store.
I don't know, it's kinda hard to reason about sometimes.
- Strange with when you have multiple
sort of derives that you don't know
which order they're gonna occur in.
And I presume, I don't know if there is even a,
if it's just a sort of a luck kind of race condition thing,
or whether it's just a sort of like how at runtime,
or whether it's how the code is compiled.
I haven't looked into this.
But basically, it's not reliable,
so you need to think through,
you can't have, I suppose that's effectively
you're having a kind of weird sort of side effect
in some sort of way happening there.
So anyway, so I've learned that the hard way
that you're kind of like,
you need to sort of think through this thing.
But often it just means inserting another kind of,
another sort of derived store.
But it can be, it can get a bit of a mad thing.
In fact--
- It's kind of similar to the reactive statements, right?
- Yeah, exactly.
- That it's like you don't know
which one's triggering in what order.
But it's a bit clearer, probably.
- I forgot his name again.
You mentioned earlier the video guy.
- Matia?
- Matia, yeah.
I think he also had that thing where he was demonstrating
where he built a nice sort of diagram tree
that was showing some of the interactivity.
I would love if we could do that with Svelte generally.
If it could have a kind of, you know,
show the entire tree of interactivity.
- Like, I've always felt like the kind of developer tools
are a bit lacking in Svelte.
- Oh really?
- In the sense that like extensions for the browser,
like I know there is one, there used to be one,
but I don't think it's updated anymore.
- Right.
- Having something like that in there would be nice
to see like the, oh okay, so this is happening.
- Yeah.
- This thing is updating this thing.
Or maybe like if you could see something updated here
and then you could see, you could go back
and through the history and see like
in which order it was triggered
and why it was triggered and stuff like that.
- That's true, but what was that amazing tool
that was demoed at Svelte Summit
where there was a--
- Oh, the Svelte inspector.
- Yeah, that's it.
- Yeah, that one's really good though,
but that's another kind of thing.
I always forget how to enable it.
- Yeah, I've realized--
- So I never enable it.
It's very frustrating because I know
there's documentation somewhere.
Like, oh, you just put this in the config,
but then there's, I always wonder like, which config?
There's the Svelte config and then there's the Vite config.
And I never remember where, I wish it was
already enabled by default.
- Yeah, I need to, I'm gonna do that next week then,
is enable it and remember, because ages and ages ago,
I never had actually a chat with Rich.
I mean, it's amazing as well how many things
you can kind of say, can you make this happen?
And it somehow does.
'Cause I was saying that there's no,
there aren't sort of source maps for HTML.
So it's weird that you can kind of in the inspector,
you can say, where does this bit of CSS come from?
It tells you, where does this bit of JavaScript come from?
But when the HTML is there, you're like,
where did this come from?
It's like, sorry, no idea.
But that tool effectively kind of does that for you.
- Yeah, because you can click something
and then you just end up, well, you don't click
in the source, right?
You just click the element on the page, right?
But it's actually, it's a very cool feature.
Like, I don't think--
- I bet it could do it from the source as well, actually.
- Maybe it can.
- I'm sure it could do it from the DOM too.
- I mean, it makes sense, right?
If you would just do it somehow.
But yeah, for those that don't know
what we're talking about, we're actually,
we're talking about something called the Svelte Inspector,
which is basically a tool that lets you click.
So you basically enable the tool by adding some config
and then you hold down a key
and then you click anywhere on the page
and then that opens up your editor
and at the correct line and at the correct file
and everything.
It saves a bunch of time.
I remember me and Dominic, the guy that made the Inspector,
we were talking about how you could,
what if you added an editor inside of the browser?
So you could just click it and then it would pop up
like a panel and you could just edit something
and then save it and then it would just update.
You wouldn't even have to switch context to the editor.
You would just like, I don't know how it would work
and it would obviously be like a very limited version
of a real editor.
- Well, that could be very handy though, yeah.
- But if you just wanted to change like a value
in the fade transition to see,
to make it look faster or slower, I don't know,
whatever, right, I think that could be nice.
Or what if you could shift click the element
and then you would get a list of attributes
that you could change on the component.
Like you could do so many things with something like this.
- Yeah, that would be good.
- Yeah.
- It's one of those weird things,
'cause I find I'm definitely guilty of this
where I get so stuck in my ways with the kind of,
you know, the sort of editor and the sort of general setup
I have and I can sort of see things.
So I'm like, oh, this looks better,
but I'm like, I don't have time
to retrain my brain right now.
Actually, I find often December is quite a good month.
It tends to be a sort of relatively quiet month.
It's quite a good time. - Like a lull in,
especially the news cycle, maybe?
- Yeah, news cycles, it tends to die off,
'cause everyone sort of stops creating events and news,
usually, hopefully.
I mean, that's sort of like natural disasters
and things like that hopefully don't happen.
Yeah, so that can be a good time
to kind of re-evaluate your own sort of tools and processes.
- Yep.
Yeah, I've been trying to use a new editor lately.
It's called ZED.
- Okay.
- Which is like a natural native application.
So it's not like a web view or something like VS Code.
I feel like it's nice to, when you click a file,
it actually just pops up with the correct stuff instantly
instead of having to wait for a bit.
I mean, it doesn't take that long, usually, in VS Code.
It's usually very fast, at least on my computer,
but you can still notice sometimes
the syntax highlighting lags a bit, and then it shows up.
- I think there was an interesting thread a while ago
on Hacker News about this.
It's very hard to, it'd be interesting to kind of,
you can't go back into the past,
and how much of this is just kind of,
what's the word for it, like nostalgia or things like that?
But they were sort of saying about
old kind of text-based interfaces and how fast they were.
And you were kind of like,
when you were back in sort of DOS and things like that,
and they were like, oh, everything just happened
at 200 milliseconds or less, and it just felt instant.
I'm like, I don't know if it did, though,
'cause I know at some point, there was this thing where,
I can't remember where it was,
but at some point I turned on, this was many, many years ago,
but even still, I switched on this old 486
or something like that, and I could not believe
how slow and noisy it was.
I mean, it sounded like a little machine gun
was going on inside it, with the noise of the hard drive.
- Like the hard drive, yeah.
- Yeah, and, so I don't know, but I feel like--
- Rose-tinted glasses, maybe.
- Yeah, I mean, also as well, I definitely remember
that I could, sort of back, sort of early days at school,
that you could overtake the speed of the computer,
but you kind of knew what the commands were.
In fact, yeah, where you would sort of like,
yeah, you would sort of like type it in,
and it would just be filling up the sort of keyboard--
- Right, right.
- And then it would kind of like, you know,
all your commands would sort of suddenly execute after that.
So I don't know, but it probably was that, that it wasn't.
But I mean, I think we kind of, it goes back and forth,
you know, it's kind of like processors have got,
sort of, you know, much faster, but we're continually
sort of slowing down the interface.
And yeah, I don't know, it's a tricky thing.
I mean, actually, I know that Chrome has recently
changed their sort of performance tab,
and tried it out the other day.
- I use Safari all day, every day, even for development,
which is kind of unusual.
- I was forced to use it for a while at work,
because for some problem with Chrome,
I couldn't understand.
In the end, I just re-imaged my Mac because I was like,
I just have to be back on Chrome.
It's weird though, actually, because in my personal life,
I use Firefox, so I'm kind of like between both of them.
But yeah, it's, I mean, actually, that's one of the things
that I sort of, not exactly miss, but it's kind of,
with graphics, because, like you were sort of saying,
the way that they, because it's news, so you work on them.
So it's one of the joys is that because we're continually
creating new graphics, it's a great opportunity
to try out new things, because you're like,
let me try it, see if it works, and if it doesn't,
well, you kind of either throw it away
and kind of make it work some other way,
or you, but quite often you'll be like, this was fine,
but I didn't really enjoy it, or it wasn't that amazing,
so I won't use it again.
But with that as well, it sort of, it means that there's not,
in a way that if you're just sort of working on the same app
for years and years and years, you can spend a lot of time
kind of thinking about sort of performance
and probably working in Chrome.
Although I say that, I was like, I say you could,
it doesn't feel like people are doing that that much.
You know, there's so many really terrible websites
out there that are really slow.
- Unbelievably slow sometimes, right?
Even just simple websites sometimes are really, really,
really slow, sometimes, like it boggles my mind a bit,
like when, especially when businesses have very slow
websites, it's--
- I found as well, actually, it's interesting,
'cause I work quite a lot with the data structures
that we use, and so particularly for elections,
because it's something where we're going to be fetching
that data an awful lot of times,
and there's going to be a lot of people doing it.
And so I find that it's hard to be CSVs or TSV,
'cause it's just, you're just kind of, you know,
normalize it down to the sort of smallest thing, and--
- Right, right, it's just like number, comma, number,
comma, number, style, right?
- I mean, we do, I've gone, 'cause I like to optimize,
I've done a bit of extra sort of tweaking,
where I kind of like tweak how dates work,
and if it's true or false, just remove the falses,
and you only put one as a true value.
But all of that, it kind of, it does add up,
this sort of, this bite-shaving--
- And election data is probably quite a lot of data.
- It's not-- - Not that much?
- Well, it's not loads, I mean, for the US,
I think there's, off the top of my head,
maybe three and a half thousand counties,
or something like that, so that's at that very fine level.
Otherwise, if you're just doing it for the states,
so we probably wouldn't, I don't think we're doing that
for the, as a sort of a default view,
that's more like a detailed view.
But, I mean, we also do it where we sort of break it down
by state as well, and things like that.
But, yeah, I mean, it's one of those things where
you can spend a lot of time being like,
trying to get a sort of file down from like 60K to 50K,
and then you look at these sites,
and they've got like a 12 megabyte video,
or something like that, and you're like,
yeah, why am I even doing this?
And also, it's hard, but the thing I suppose is
to remember that code and data kind of have
very different sort of performance effects
from like a video is just gonna be, you know,
fetched somewhere in the background.
- 12 megabytes of JavaScript, though.
- Yeah. - That's gonna slow you down.
- Yeah.
So, it is kind of strange like that.
But, yeah, it feels like it would be,
it would be quite fun in a way
to work on a really big app
that was just a sort of ongoing adventure.
I mean, we do have that bit, actually.
Our internal tools use Svelte as well.
- Is that something you work on as well?
- Some of them, yeah.
It's our publishing, the internal publishing system
that we use just for graphics uses it as well.
- Oh, cool. - Yeah.
But it's one of those things where
there's a whole load of urgent things,
and so it's always that kind of like,
which is the most urgent, and so that hasn't been
refreshing in a while. - That's the same.
I think that's the same in pretty much all business, though.
Like, it's always like a trade-off
of how well can we do it, and how fast can we do it.
And you have, like, business usually leans towards
do it fast. - Yeah.
- Which, in the long run, can probably slow you down a bit.
- I think also with internal tools,
you're kind of like, at what point,
you know, the goal is never the internal tool,
so the tool is to sort of enable something else to happen.
- But I find that it's nice to have the view
that there are, like, you have users
for your internal tools, right?
So they have to work, even if they,
obviously, like, maybe I'm contradicting myself now,
but like, they don't have to look as good
as the stuff that you put out in the public, right?
Because it's just a tool that someone is using.
But then, there's a nice feeling of using a tool
that, like, kind of sparks some joy.
So it kind of, I don't remember who it was,
but I think it was Josh Nussbaum,
he did a talk at Svelte Summit.
He said on Twitter, what was it, something,
I think I mentioned it before,
but like, how code affects your,
like, the quality of the code base
affects work-life balance.
Because if the code is bad, you go home
and you're tired because you've been thinking
extra hard about how to do something
that should have been easy.
So, I don't know where I was going with this.
(laughing)
I had some, I was gonna make some point, but yeah.
Let's move on.
(laughing)
It's just like a quote that I like,
'cause it's a thing that I've never thought about it
in that way, but it's very true.
Like, if you're working in a, well, all right,
so this was the point, like, if you're working in a tool
that is hard to use, then you're gonna be frustrated
and you're not gonna be happy working, right?
So, even if it is an internal tool, it is important.
- Yeah, now I think with it, it's like,
I mean, at the same time, actually, it's funny,
'cause design-wise, because we know it's internal,
it's actually, it's more like a thing to have fun, actually.
- Oh, nice, yeah. - Yeah.
'Cause there's a lot of design-y, creative people
on the team as well, so often it can be kind of like,
let's just ask them to do, submit something,
sort of fun icons or things like that.
But yeah, I think, yeah, it's a mix,
but it's kind of like, yeah, as you said,
there's always the sort of trade-offs as to where
you sort of are spending the time and energy.
- Yeah. - Yeah.
- Oh, should we make it look cool
or should we add this feature where I can,
that simplifies life for everyone?
- Yeah. - Probably the latter, right?
Do you wanna talk about side projects?
- Yeah, so, well, I was gonna say,
so I've mentioned already about that I did
that degree at Goldsmiths.
And so my, so it was weird, 'cause it started in 2019,
and so I was graduating during COVID,
and it was a strange time, because we weren't sure
if we were gonna have a final show at all.
- Oh, and it's very visual, I suppose.
- Yeah, so typically you have a big end of degree show,
and there's, I think back then there was about 80 people
doing the course, and I think it's now grown to over 100,
so it's quite a big show, and you're given a bit of wall space
or floor space, and people build all kinds of amazing,
sort of interesting, sort of artistic coding things.
And so yeah, so it was unclear as to what exactly
was gonna go on, and I was like,
well, and also with that, we didn't have as much ability
to go into the university and use the sort of lab
they have where it has a lot of sort of tools,
like the sort of laser cutters and printers
and things like that.
So I, yeah, so anyways, it's interesting, early in lockdown,
everyone was saying how they had these sort of
strange dreams, and I was sort of thinking about that,
and I have sort of quite strange and interesting dreams
as well, and so we were kind of like
in this little crit group, and we were sort of talking
through ideas, and so that was the sort of idea I pursued,
where I was sort of looking at how,
sort of the kind of ideas and sort of connectedness
within dreams, and are we, 'cause you often wonder,
or I wonder, is like, are we having the same dreams,
are we, or it's like, 'cause there's always that sort of
idea about where does sort of like consciousness
kind of come from, and where are we like that,
'cause it's sort of like, I mean, I don't know,
this all gets into all sorts of weird philosophical bits
about like the simulation hypothesis or things like this,
but we're having all these sort of like thoughts and dreams,
and we're like, where are they coming from,
and what are the sort of relationships?
- Even just like, what's the point of a dream?
- Yeah, it's all kind of strange like this,
and what was quite fun with this is you can take
quite a lot of the sort of skills that you have
from journalism, and applying them in an artistic context
is really quite fun, because you don't have to have
the same integrity, it's like in journalism,
you're always like, where does this data come from,
is it a sort of reasonable source, and all of this,
and in the art world, you're kind of given much more
sort of liberal sort of license to sort of play around
with things, so I scraped a whole bunch of dream
diary entries, there's a couple of sort of sites
which sort of have these, and it came to about
100,000 dreams, I think, in total.
- Oh, wow.
- And I used Word2Vec, which was that sort of,
it was issued by, I've forgotten the name of the people,
but they worked at Google, and it was one of the early
kind of sort of language models, and it's still, honestly,
it's kind of, it's witchcraft a bit to me,
how this even really works, in that you can basically
just feed in lots of text, and it just sort of,
somehow, there's sort of multiple levels of magic,
but somehow a sort of tokenizer is able to work out
what makes good tokens, so you're not explicitly saying
just split up space, it is able to sort of do more
cleverer stuff than this.
And then from that, it will work out kind of relationships
between words, and then you just get back these vectors
of the words, of the terms, and it absolutely does work,
where, I mean, you'll see this in these sort of explanations
of how does sort of word vectorization work,
where you can sort of, you know, you sort of,
they would say, like, take the word queen, and add male,
and you'll be the nearest node in the high-dimensional space
will be king.
- Oh, right.
- And they were sort of saying you could do things
like take the word Iraq, and subtract violence,
and you get Jordan.
- Oh, right, yeah.
- And so, it was really interesting with that,
so I basically, and it's nice because it was 100,000
sort of entries sounds like a lot of text as a sort of human,
but to these machine models, it's nothing really.
- Yeah, like these days as well, like how much data
are OpenAI or training their models on, yeah.
- And so I think I got it to output, I think,
at 100 or 128 dimensions, or something like that,
for all of the terms, so you get sort of a weight
for each term, and then, I'm trying to remember what I did.
- So you took the diary texts, and fed them into the,
and then you got tokens out.
- Yeah, and so I think I was using 100 dimensions
at the kind of, where it's working out the relationships
between them, and then there's an amazing algorithm
called t-s-n-e.
- What, what?
- T-s-n-e.
- T-s-n-e?
- Yeah, so it's t, lowercase, dash s-n-e.
I can't remember what it stands for now,
and it's a way of taking, of reducing dimensionality.
- Okay.
- So you can take these 100 dimensions,
and say reduce this to three dimensions,
and so it's kind of, it's sort of like you're taking
a sort of cosine difference between all of the values
across these high dimensions, and sort of reducing it,
reducing it, reducing it down.
- Sounds very complicated.
- It does, yeah, I mean it's again, very maths-y,
and clever, and it's, Google have a interactive form,
which is really quite satisfying to watch,
'cause you have sort of all these things,
and just a completely sort of jumbled space,
and then it sort of squeezes them,
and it looks a little bit like,
have you seen when starlings, or birds,
do those flocks, where they, there's a word for this,
what's it called, the word has escaped me.
But anyway, there's a special word,
where they sort of all fly around in formations.
- Yeah, yeah, I know what you mean, yeah.
- And so it looks a little bit like that,
and then it kind of like, it sort of flattens it out,
and it's like, and then it's resolved,
and then the sort of, you know,
the amount of change is disappearing.
So I used that to basically put them
into this three dimensional space,
and then used a lot of the D3 tools
for sort of geographic projection.
So I then projected it to this stereographic projection,
which is sort of how you would look at the nighttime stars.
So that's, it's a projection where basically
you assume you're in the center point of the Earth,
and you're kind of looking out for a sort of sphere,
which is effectively infinitely far away.
- So I'm looking at it right now, it looks very cool.
I thought it, like when I first came into the room,
I thought it was like, just an image of the,
like star signs and stuff,
like when I initially looked at it.
- That's good, that's the intention, really.
- Yeah, yeah, great success.
I'll try to take a photo and put it in the description.
- There's a blog post as well on it.
- Oh, nice.
- And yeah, so I used Svelte for that,
because again, it was just, I mean, I think,
so it's, being able to make components
just is such a huge sort of game changer,
'cause it's just so relative to, you know, how,
'cause I mean, it's like, I've been writing HTML
and JavaScript long enough that we sort of,
the backbone was a big sort of breakthrough.
- Right.
- Because it was kind of like,
that was sort of more like a sort of structure
as to how kind of things could depend on other things.
- How you could reuse things.
- Yeah, but I mean, and then we,
but we were still using D3, which I mean, D3 is excellent.
But the, I feel like the select kind of update pattern
is conceptually quite complex, it's very powerful.
And it's particularly powerful when you have
very sort of particular or complex kind of animations,
because you can sort of just select the piece you need
and kind of transform it in a way.
So it was both, but it is with that,
it's difficult to understand.
I think also it's, and that again is sort of partly again,
with going back to the sort of very early days of Svelte,
we had used D3 before for elections,
and it was working great, but we would get memory leaks,
because it was just harder to know what you were doing.
And normally on a graphic, it doesn't matter too much,
because you kind of like load the data,
do a big load of rendering, and it's done.
Maybe you have some little interactions
and perhaps they're leaking a tiny bit of memory,
but it doesn't matter that much.
Whereas with the election, it's like every 30 seconds or so,
you've got new data coming in.
And if that's causing the whole DOM to re-render,
but at the same time, you're like accidentally sort of,
you know, leaking memory on every single node.
- You're gonna have a bad time.
- Yeah, and it was things like that.
So you would find, it wasn't terrible,
but you could find that maybe after half an hour
or something like that, you would, Chrome would crash.
- That's half an hour isn't even particularly long, right?
To have something like that open.
- Yeah, exactly.
- Especially if you're like watching the election live
and you're like waiting for the results.
- So I think, you know, I think we, I don't know,
I don't think we had it as bad as that in the end,
but it was kind of like, it was evident that, you know,
we were having to spend more time thinking
about how our D3 sort of use was,
what we were doing and why we were leaking memory.
And it's felt, you just don't really think about it.
You just, you're just like, as long as you sort of,
you know, you do your mounts and unmounts correctly,
it's great like that.
- Yeah, unmount and unmount going away.
- Yeah.
- So I feel good about that.
- Oh yes, oh are they?
- Aren't they?
- I think you're right, they are.
- I think, I think.
- Let's, let's double check before we spread,
spread chaos in the, in the, in the podcasting world.
On mount, unmount, was it, what's it called?
Is it called unmount?
- No, it's destroy.
- Destroy, you're right.
I don't, I don't, I'm not finding anything here.
Maybe, maybe it's not going there.
- I think they're gonna stay around.
- Yeah.
I don't know, we'll see.
- Yeah.
- Maybe they, maybe it might be.
- In the long run.
- In lower case or something like that.
Who knows, it was a bit of a,
that's a sort of slightly strange thing
where on clicks, on colon click has become on click.
- Well, I mean, it is strange, but not really.
- Yeah, once, once you've.
- Once you've realized that, oh,
it's the HTML way of doing it, so.
- Yeah.
But yeah, so that's it.
So I use Svelte in a bunch of,
sort of side project creative things.
I think as well, maybe it is also I'm a bit of a person,
who just sort of likes having a structure
kind of already there for me.
- Yeah.
- Because I mean, ages ago I used to use Ruby on Rails.
And again, it was, I felt it was,
it was useful to have a kind of common structure.
And then you were like,
how are you deviating from this and why?
Rather than sort of, you know,
you get projects where every person
has just done their own sort of little cool thing.
And you're trying to work out.
- And that's very cool, but you don't understand anything,
right? - Yeah.
- It takes like six months before you understand anything.
- Yeah.
- But yeah, it's, that's why SvelteKit is so nice.
- Yeah.
- For me at least.
Like every time I need a new page or anything,
I just like initiate a new SvelteKit project
and I'm ready to go, right?
- I keep meaning to make my own personal website.
It's like, there's so many side projects
which I never kind of get finished.
I'm kind of keep saying,
I've been saying to a bunch of people,
I really need to just organize this myself
in a sort of low key way
about what we just have hackathons
where you're not allowed to start anything.
You just bring a project that you've been working on
and you finish it.
- That's a fun idea, actually.
I've thought about like, so back home,
I've thought about like,
'cause I wanna get a couple of people together
and just like in the space where we work on stuff,
but we don't necessarily work on the same thing.
It's just like a hackathon style thing,
but we just sit there and work.
I guess that that could be like a coworking space,
but then--
- Well, ages ago when I lived in New York,
this friend Michael Keller, we have this group
and it still kind of runs sort of in a sort of sporadic way,
which we named CSV Sound System.
And it was just us meeting--
- How does a CSV sound?
- Well, I don't know.
That was one of the funny things actually,
is we had this name and we for ages were kind of like,
as if at some point we would actually start making music.
And there has been a bit of that.
They did make, somebody made a thing
where they kind of audio-lized
the sort of US Treasury report or something like that.
There's definitely, there are projects out there
'cause people have sort of said about this,
there's quite a lot of projects where you can use Excel
and various other things as if you're making
like a sort of a beat tracking kind of thing.
But I mean, yeah, that was the name of it.
But it was quite nice in that we would just meet weekly
and it would just be kind of work on your side project.
'Cause I think there can be that kind of thing
where just in a space with other people,
you can be sort of productive in a way.
- And you like, you go there and you know that
this is sort of a social thing,
but it's meant to be like a work and like,
maybe you have food or whatever, but like--
- And 'cause I suppose also you both get,
it's interesting where you get direction.
People are kind of like, wow, that's really cool.
People like, I don't, it's clear
they're not quite understanding it, yeah.
- Why are you doing this?
- And things like that.
It was, I used to go to, I think I,
no, I don't think I remember anymore,
but the London Hack Space as well.
And that was one of the things I remember the most
is I was there and this guy came in
and he had like this great big long rope of LEDs.
And he, you know, you're like, oh, what are you doing?
He's like, oh, I'm making this like one pixel game.
And I'm like, oh, okay, yeah.
You kind of like talk through it and I'm like, yeah.
And I'm like, okay, yeah, that sounds kind of interesting.
Like he's a bit mad.
And then the next time I see it, I'm at the V and A.
- The V and A.
- Sorry, the Victoria and Albert Museum in London.
They had this exhibit on games and his game was there.
I think his name's Robert Balcoma, is it?
If you look for like one pixel, and it's really cool.
It's like when you play it, it's actually,
I've seen a talk as well, he's talked about it.
'Cause he actually, it's got this sort of big spring
that is kind of the controller.
So you're basically just, you control one pixel
on an LED rope.
- Okay.
- And you're just sort of moving along.
- Kind of like Snake?
- Yeah, and so there's kind of,
you're sort of having to go over like a sort of a fire pit
or things like that.
There's a lot left to the imagination
as to what these sort of obstacles might be.
But it's one of those things where it's just like
the sort of joy of the sort of interaction.
- Yeah.
- It's really cool.
But yeah, it's that kind of serendipity
and where you're sort of, and it's nice,
you know, where you, that sort of thing
where you sort of, I'm like, this seems mad,
and then you see it when it's finally done.
You're like, wow, this is really cool.
- Yeah, yeah, and he probably worked on that
at like that hacker space probably for quite a bit, right?
- Yeah, for ages, yeah.
He's also built this amazingly beautiful thing
with LED rings, a bit similar to that,
where there's a kind of, again, loads of these springs.
It's weird how, I think, because he just wanted a spring
as a sort of a bit like a joystick
and went down this enormous kind of rabbit hole
of like spring stuff.
A lot of his talk was about that,
'cause apparently there's some company in West London
where you can just make,
where they'll make custom springs for you,
which is what he ended up doing,
'cause he was like, none of the springs I could find
were quite right.
And, 'cause I think, is it Hooke's Law
or something like this?
I don't know if you studied this in physics,
but you know, there's a whole kind of like,
sort of early physics of like springs,
and it's the whole kind of interesting thing about it, but.
- I'm sure it's way more complicated than at first glance,
like everything in the world.
- That's it.
And, but yeah, just really beautiful interactions with LEDs
and making just sort of these lovely sort of smooth
kind of color transitions and things like that.
- Yeah.
Yeah, like having a space to go to work on side projects
and stuff like that.
That's a, it's a productivity boost.
It would be for me, at least.
- It's a tricky thing,
'cause I know the London Hack Space has been,
there's been sort of, I think, kind of political issues
and things like that with it and all of that.
But there's also, well, you know,
sort of like, it's one of those things where as it grows,
you know, you kind of,
like you can be a victim of your own success.
- I see what you're saying.
- So many people where they're kind of like,
oh, it should be going in this direction or that direction,
or you know, like.
And, you know, when it's sort of like,
when everything works where it's a nice community
and everyone sort of like puts in at least the minimum,
like more than the minimum effort that is required,
you know, things work well.
And then when people are sort of like,
and so it's also been difficult
because I think that this is one of the big problems
of where London has just got so expensive.
- Right.
- And so it's had to move around a bunch.
And so areas where it's,
and it is like,
you can't be that central.
- Keeps moving further and further away
from the center.
- Yeah, and so it's like, it's obvious,
the further it is, it's sort of like if it's in,
I think it's Northwest London now.
And so it's harder, it's very tricky
if you're in sort of Southeast or something.
But I mean, I think there are smaller ones have sprung up.
So perhaps that's, you know, the way in a way that is,
you know, there's successes that smaller other ones appear.
- Yeah, I think,
I don't know if you'd want it to be that big.
Like, maybe 10 people is enough.
- Well, that was the thing 'cause I joined pretty early on
and I can't remember what they topped out at,
but it was like, it was really scary
the way they were sort of something up
to something like 20,000 members or something like that.
- Yeah, oh wow.
- And you're like, wow, yeah.
- How do you organize 20,000?
- Yeah, but there's other fruits as well though,
come out of it.
So there's also, I don't know if it's directly related,
but there's also an EMF camp in the UK,
which is electromagnetic field.
And that's a really fun festival,
which is organized by John T,
who was one of the Hackspace founders.
And yeah, so that's like nerds camping in a field.
Actually, yeah, you were asking earlier.
- Wait, I think you were talking like last time we met.
We, I think you talked a lot about this.
- So yeah, that's really fun.
That's, this is the badge actually from that.
So every year they've been sort of giving,
I think, I don't know where this began.
I think it might've been,
there's some other sort of hacker related conferences.
I think it might be Black Hat or something like this
where you were kind of getting,
they started giving out chipsets as badges.
- I'll take a photo of this as well.
- So I don't know if it's got any power at the moment,
but the, yeah, so there's a lot of really interesting
sort of fun things like that.
I think actually as well, just going back to Svelte.
And there's lots of stuff with Svelte
where I feel like I would like to contribute more.
And it's like, it also looks like it is now quite complex.
I mean, it's always been like this.
And I think as Richard sort of said that there's,
one of the problems is it's like,
you're having to think about code that generates code,
which is just inherently quite complex.
But I think as well, there's like,
the docs are always really fantastic.
And I feel like there's things like that
because I know as well, one of the things
that I really liked early on was that we were using,
because we were using Svelte just,
'cause we just felt for the front end.
And so now we tend to use SvelteKit
and everything is very harmonious,
but I think there's still a lot of people
that are using PHP and various other sort of like static,
sort of the front end generation bits of it,
the sort of the static HTML.
And yeah, so sort of, I think keeping them
as part of that community is an important part.
- Yeah, there's been some work on,
like not by the Svelte team,
but by others where they've tried
to integrate other back ends.
So I think one was like the hackathon yet last year,
I think there was a Django thing.
I don't remember if it was, I think it was called DX Svelte.
Right, and it's basically lets you use Svelte
in your Django project somehow, yeah.
- I think that would be really good,
'cause I think a lot of people, it's quite easy to,
but it's strange, I mean, I go back and forth
about the sort of the take up,
because it's like Svelte is now definitely at a point
where it's got enough popularity and momentum,
but it's not kind of going anywhere.
- Right, yeah.
- And it's like there's, it's weird though,
it still seems, always, always,
that the primary thing people seem to argue about
is whether they like templates or not.
And they're like, oh, I don't like handlebar type templates.
- Yeah, but I mean that's, do you think it would,
like, how would you get away from--
- Yeah, I don't know if it would make that much difference.
Also, to some extent, I'm like solid JS,
and if you don't like, if you want to do it,
I'm like solid JS has lots of great features,
and Svelte has benefited from a lot of the thinking
that has gone on there too.
So, I mean, it's not like we want,
we don't want just one framework to be the winner.
- And that's kind of one of the,
the downsides, I would say, of Svelte 5
is that it moves closer to the other frameworks, right?
- Yeah.
- I mean, obviously, it's not the same,
but you're introducing effect,
which sounds a lot like the use effect thing in React,
I mean, sure, it's not the same thing,
but maybe you stopped using React
because you wanted to move away from that.
It's, to me, it feels a bit like,
even though I'm very excited about Svelte 5,
it feels like it's losing a bit of its simplicity.
I think we touched a bit on that earlier.
- Yeah.
- But yeah, I worry about that
rather than people arguing about handlebar stuff, templates.
Like, that's more of a worry to me
that people that have never once coded anything
in their life, picking Svelte up
and feeling rather than, oh, this is just HTML
and I don't have to worry about all this other stuff.
- Yeah.
- Suddenly feeling what is an effect?
- Yeah.
- What is a derived, like, what is this?
So that's one of my worries
that we're gonna lose that bit.
There was a, at Svelte Summit as well,
like a couple of years ago,
there was a talk about, I think a school in Norway
that was using Svelte as like a learning,
like to learn software development
because it was so simple to introduce to people
and you instantly get something on the screen.
- Yeah.
- It's so simple to get started with.
But yeah, that's one of my worries.
Maybe it's unwarranted, but we'll see.
- I mean, I think, yeah, we do need to see how it goes.
I mean, well, the thing is, it's,
the good news is that it's sort of,
it's maintaining backwards compatibility.
- Yes.
- But yeah, I think it might be that it's like,
to what extent does the,
it'd be difficult if the take-up of Svelte 5 is less
than we were hoping.
I mean, I'm not sure how the backward compatibility
is maintained as well as to whether it's sort of basically--
- I think the plan is to deprecate Svelte,
like the old syntax in Svelte 6, right?
So it is going away, but not yet.
- Yeah.
- There's, like, it also depends a lot
on what you're trying to build.
- Yeah.
- Because, so like I mentioned,
I only really use SvelteKit, right?
I let the load functions and the form actions handle
all of the, like the reloading of data
and like refreshing stuff.
For me, Svelte 5 is mostly just like I have
to write more characters, right?
- Right.
- But I mean, that's, we're talking about four characters
per state thing.
So it's not like it's a lot, but.
- Yeah.
- And in some places you save some characters
and it's also like it's, I guess it's more clear
what state is.
Oh, this is state, rather than just--
- Yeah.
- Some random variable.
- Yeah, I don't know.
I mean, I think, 'cause I was sort of saying
how that was at that creative coding meetup yesterday
where they had, we were looking at using p5.js,
which again is, I mean, that's a great introductory tool.
So that's a, it's a JavaScript fork of sort of processing.
- Oh, right, yeah.
- Maybe re-implementation rather than a fork actually.
And I kind of go, I'm not,
I think it's a great thing to learn.
I feel, and I think actually, honestly you could,
you could definitely do amazing big things with it.
And I think it's just because I've kind of come from
sort of other angles that I tend
not to use that sort of paradigm.
But they've done an amazing job as well
of like bringing in sort of really good libraries
straight into it so you can just,
which was sort of one of the demos yesterday
where you can just be like, I want a webcam
and put hand tracking and it's just your--
- It just works.
- Yeah. - Yeah.
- And that kind of thing.
- That makes it very easy to get started
and actually build something that's interesting
rather than like, oh, this box changes color
when I click on it.
- So I'm thinking it might be though,
to some extent with that, that it's,
in which, so I think that still could be
that the direction is that Svelte is,
'cause you want to build the most kind of
sort of valuable and best written sort of like thing there.
And you could always be like,
let's make a sort of subset and easier
sort of idea of it, which is more,
if there is that kind of thing
of like where people are wanting to kind of--
- Yeah.
- I think I agree with that.
There's people who wanted to build incredibly big,
complex web apps, sort of huge sites,
because even without the graphics that we build,
they're complex in their own way,
but it's not, there's a sort of a different level
'cause there's not that much sort of statefulness
and things like that actually going on.
And then yeah, there's people who are sort of more
where you're just sort of,
you just want to code your own website,
but have sort of a lot of control.
- Yeah.
- So I don't know, I think it would be hopeful
that we can sort of tune it to those different needs.
- I hope so as well.
I don't want the case to be that like,
I just don't want people to like pick it up
and then put it down because it looks too hard.
- Yeah.
- And it is also the case that like Svelte 4 is,
it looks easier probably than it is.
Like once you start using the reactive statements,
then it gets a lot more complicated
than you might think at first glance.
- It's funny actually though,
'cause I know that there's sort of,
I've seen those sort of long,
which is I guess what sort of triggered
the whole sort of change in a way,
where there's a few issues around how,
I mean, I think sometimes it's just a bit
in terms of what's going on,
where there's about three different ways
of making something reactive.
- Yeah.
- And they generate quite different code,
even though sort of on the conceptual level,
they look very similar.
- Yeah.
- And then there's also where people kind of use that
in a particular way, 'cause it's kind of,
and to what extent you could sort of say it's not exactly,
I mean, there's kind of like, there is the API.
So within that, it's a valid use of the API,
but you might be like, well, I wouldn't do it that way,
but whatever it is that people have done.
And then because of that,
they've ended up with sort of behavior
that is not as they expect and is also is incorrect.
- Yeah.
- And it's hard to know really with that.
I mean, you could kind of be like,
well, maybe if you took the app
and you would sort of rewrite it in a different way
and that behavior could be eliminated
through other sort of design choices.
But it feels like those problems are real.
And so that is where I think that 5 has a sort of
consistent sort of approach to things,
which at least it doesn't mean it eliminates those problems.
It just means that they'll be consistent.
- Right, yeah.
- And I think with that--
- Consistency is great, by itself.
- It is, yeah.
But I think with that as well,
it's weird because I think we may now find as well though
that yeah, the effect sort of ruin
is where strange things will be put into there.
- Yeah, people would just use that for everything,
even for things that should be derived.
- Yeah.
- Probably is my suspicion.
Like they're gonna be like,
why should I use derive when this thing--
- Yeah, 'cause they'll be like,
this thing isn't doing it when I expect
or just stick it in here.
'Cause I mean, essentially that is I think the algorithm,
the internal sort of thing that I think.
- Oh, for sure.
- Something isn't working,
I'll stick a dollar in front of it.
- Yep, yep.
- And actually it's weird how much we found at work
where things that needed a dollar
that we weren't expecting to.
- Right.
- And that's much more with SvelteKit
that it's quite easy to forget
that you have this sort of bit of data that you've loaded.
- Yep.
- And you think, oh, this never changes,
but it does because you're sort of,
when you're going from a page to a page.
- Yeah, when you go back and forth and--
- And things like that.
Or if you're invalidating data in the function,
like then it reloads
and then maybe you accidentally de-structured the data prop
into like, you know, const,
what could it be, like a posts equals data.
- Yeah.
- And then, oh, you realize now it doesn't update
because I didn't put a dollar sign in front of the...
Those kind of gotchas are going away though, right?
Because in Svelte 5, the data is a ruin, right?
So it'll be fine-grained, I think so at least.
I'm pretty sure that's the case.
So you can do stuff like that.
- Actually, one of the things I don't know,
and I'm always keen to ask questions
where like you shouldn't hold back
just because it might make you look stupid.
But does fine-grain, like, 'cause you have your template,
if, is it able to...
So I guess it's like it still is attempting
to render the entire template,
but it is able to sort of be like, as it's going through it,
it will say, well, this hasn't changed
so we can shortcut going over that.
But it's not like it's kind of like,
if this variable sort of maps to this bit here
and that bit maps to there,
it's all still kind of one function.
So it's still doing everything,
but it's able to skip the bits it doesn't need to do.
Is that the model?
- That's a good question.
- I should find this out.
- I don't know.
I know there's like one of the...
I think it's in the first blog post
when Rich announced runes, there's a video as well.
And in that video, he shows like a list
where using Svelte 4, and you open,
I think he opens the, what's it called, the inspector.
Oh, no, wait, he does something to show
that like the whole list re-renders in the old version.
And then in the new version, it's just the bits that,
I forget if he logs it or it's, wow.
- I think he flashes, he has a--
- Yeah, that might be it.
- There's a use, I think, which is kind of like
when this thing is it, you just play an animation to it, yeah.
- That could be it, that could be it, yeah.
I'm not sure.
Yeah, exciting times.
- Yeah, actually I find it's quite often as well,
it's like, if you think you might need,
or you could use another component,
it's often good to do it.
Components, just the way I work and sort of have seen it,
that you get components that are too big.
And it's very often as well, things I've found as well
where it's much easier to solve it,
because the point at which the component
is instantiated as well, it sort of,
it's then sort of encapsulated the whole thing.
And sometimes, yeah, I mean, like applying a,
you know, a, what is the damn store called?
Where Spring and all of those things,
say tweens and things like that.
But it's actually, it's much easier often
to break that down into a much smaller thing
where you're like, this is just the tweened version
of this little tiny bit of DOM,
rather than ups, you know, in the parent one,
trying to sort of like put the tween in there.
- And then complicate all the logic, yeah.
Yeah, that makes sense.
- 'Cause you're just like, this is it.
And also, 'cause you know when it's kind of like,
this is it when it's created,
and, you know, so you know that you usually
don't want a tween on the initial value
and things like that.
- Right, right, yeah.
- Yeah, so there's bits like that where,
I mean, I know as well that people complain about,
'cause I haven't really used React,
I don't know about the joys of this idea
that you have all these sort of templates within one file.
- Yeah, I mean, I used to work in React,
and I hate that.
- Oh, you didn't like it, yeah.
- I absolutely hate it, because the files are so large,
and I know, like, yes, you can search in the file,
you can go between methods easily and stuff,
but it's just like that mental overload
of just seeing so many lines of text.
- Yeah.
- It's--
- I get really stressed once there's more than 300 lines.
I don't know how some people do it, but--
- Yeah, I mean, 300 is a lot, in my opinion.
So, I mean, I try to keep 'em small.
It's subjective, right?
- Yeah.
- Like, if you like it or not.
I think it's preferable to just have one component per file,
because it's clear.
- I suppose you're saying the difficulty of, like,
naming it and sort of how much of your structure.
I know this person at the London Spelt Meetup,
I think, how many did he say?
It was like up to 170 components or something like that.
- Right.
- And I was like, that does sound quite a lot to manage.
But, I mean, it sounded also that they were, like,
using on every, almost every element,
you know, sort of like an H1 and H2 title
and everything like this was their own, and I'm like--
- I don't know if I'd do that.
- Well, I think, were they possibly using MD Specs as well?
'Cause I think there's--
- That could be the case, yeah.
- Where they were sort of trying to overwrite
their own sort of logics onto it, but, yeah.
- Then it makes sense.
- Yeah. - For sure.
- But, I think even with that, you just have to sort of
structure them into folders carefully and, you know,
there's probably a bit more refactoring goes on with--
- Yeah.
- To keep them nice.
- All right, so we've been chatting away for a bit.
Is there anything that we've missed that you think
we should talk to or do you wanna move on to the spicy bits?
- Yeah, yeah, do the things.
- All right.
- So, unpopular opinions, I told you before we started
recording that you could bring up an unpopular opinion
if you wanted to.
- I don't know if it's unpopular, it might be quite popular
even, I think it's often the way it goes, it's a rant.
I think CSS just shouldn't exist.
- Wow.
- I think we've been doing it wrong.
- Kind of wild opinion.
- Yeah, well I think we've just, so it's also going way back
in time, there was the CSS Zen Garden, and for me that was
the philosophical kind of direction we should have been
going in, where you would write your HTML in a kind of way
that made sense to the content that it kind of was wrapping.
I mean, the big, the huge caveat to all of this is that
the web has become so much more like apps
rather than documents.
But yeah, still I think with that, I still think that
if we could talk to the people who make browsers,
the actual developers who are absolute magicians,
I don't know how it's all done, but we have all these kinds
of really complex layers and sort of hierarchies and rules
about, you know, style tags and the sort of important tag
and all of this, and it's so complex, and it's like even
just knowing what those specificity rules are is so mime.
- I mean, it's a job in itself of knowing CSS properly,
right?
- And then there's, I know they've added, I've forgotten
what they're called, is it Layer now as well,
where you can kind of do that as well?
And so--
- I think you can even type CSS variables now in Chrome.
- And so that's it, it just feels like it's, as a language,
it's got so complex, and we, and it's for designers,
we want to be able to design things in a nice way,
and I think it would actually benefit us if we were
just writing, and I think the browser could maybe help us
while we're having a sort of, or if we had a sort of more
sort of like standard, this is the way things are kind of
looking, and you're just doing it, and then it's much easier
to just apply style, and I think that would be much better
as a browser tool, and I think it would also then,
it could just write it out as a binary format.
I mean I don't know, 'cause it doesn't really feel like this,
the syntax is weird and complex and confusing.
- It's very different compared to anything else, yeah.
- And--
- Did you see the JavaScript framework
that is made to look like CSS?
- Oh dear.
- It's called a corset, it's cascading binding sheets.
- Okay.
- Reactive UI without the complexity of SPA frameworks.
- Okay.
- Maybe something to check out if you like CSS.
- But I think that's the kind of, I think there is a,
I think this could happen somehow.
I think we'd need some browser genius
to write a kind of be like, to just sort of like,
at the level at which style sheets are actually being applied
to be like, look at a format that would make more sense
to the browser, and just extract that out,
and then build from the browser a tool for making that,
and then you would just add it on, 'cause I mean,
that is the thing, is we've always had it where it's like,
you know, type equals CSS or something like that.
We could, if we could find this new format,
we could just be like, let's add another link tag
that is type of some better style sheet.
- Style.
- Yeah, and it was just like, if that exists,
just throw away the CSS and use that.
And I think that would actually lead to us
writing better HTML.
- Yeah, 'cause that's often an issue that people have,
like they're trying to write something
that looks in a certain way, rather than focus
on the structure, and the structure is important
for people that--
- And it's interesting that we have--
- Use the structure.
- There's been a bit of this with sort of Bootstrap
and a few sort of other things, but that we don't have
kind of globally shared kind of CSS as well.
I mean, I also remember that very, very early days
of Firefox, in fact, I think they've removed this now.
I'm not sure, but you know the way you could
specify multiple style tags as style sheets,
and give them, say that they were alt,
and give them a sort of title, and then Firefox
actually had somewhere in one of the menus
where you could be like, let me just do this.
So this was an early way of doing themes.
So it was weird, 'cause that was so, so long ago.
And then it sort of has slowly come back,
where suddenly, you know, it's weird that,
I feel like that's why I say about the CSSN garden,
because it feels like so ideologically,
it was kind of like, this is one piece of HTML,
but we can make it look so different.
And it's taken sort of decades now.
It's been like 20 years ago, I think,
the CSSN garden came out, maybe more.
- Yeah, so it's pretty--
- And it's like, it was, all the ideas
have kind of slowly sort of come to fruition.
It just feels like, a lot of companies
have just been forever trying to be like,
we just want to make it like a PDF.
You know, their whole goal has been like
to control exactly how it looks for everything.
And then it's been like, well, you have to make it
sort of, you know, for ages they held out
on making sort of flexible designs.
And they were like, we're just gonna make it,
you know, 1024 wide, or something like that.
And they know--
- We'll never have other screen sizes.
- And then to mobile phones, really,
that absolutely wrecked that.
And they're like, you've got to have mobile
and desktop now.
And then, you know, now there's sort of
light themes and dark themes.
And you're like, and I mean, it's also sort of
all of the ideas with accessibility
and things like that also come through.
And it feels like it would just make,
I mean, it's absolutely, it's not an easy thing.
So I'm not saying, like, CSS is really complex.
And it feels like with that, it's like
people making beautiful style sheets
that could be much more reusable across sites.
You know, it's like, it's actually the sort of
preciousness about design.
I mean, I can understand, 'cause obviously
you want things to look really good.
But I feel like there's, I mean,
it would be interesting to talk to a designer
about this, because I think that they would
also have this kind of thing where they do,
a lot of designers are like, they like actually
having a sort of a shared kind of--
- Like a design system?
- Yeah, a whole system like that, and that's it.
And I don't think CSS really does that,
because it's kind of--
- Yeah, it's--
- Or you need tooling on top of it to make that happen.
- Yeah. - You know?
- Yeah.
- 'Cause it's like, and you see this a lot where
the cascading, 'cause it's a cascading
that doesn't really work.
- Yeah, super complicated. - It sort of flows down
with complex rules that are not easily understood.
- And then you just smack an important on there, and then--
- Yeah, and so there's this kind of like,
the systematic way, so I think it'd be like
how to sort of like merge those three things together,
where it's sort of like, we're writing good HTML,
you have a sort of design system that makes sense
to designers, and then a sort of format
that can actually efficiently sort of encode this,
and an editor for controlling it.
- Yeah.
- So that'd be my big wish.
- That's a--
- Sort of controversial thing.
- I do wonder how controversial that take is, though.
Like, a lot of people do not like CSS,
but I think a lot of people do like CSS, so.
- Yeah, I think if someone, there's some amazing hacker
out there who could build this,
or maybe it already exists and I don't know about it,
but it's kind of like, perhaps it starts as a plug-in,
or someone does it as an experimental thing.
- I mean, I know there has been, like in some frameworks,
there have been attempts at doing something like this.
I think in, if you're familiar with Elm, Elm Lang,
it's a JavaScript framework.
- I've heard of it, yeah.
- It's like a 100% fully functional style
programming language for the front end,
and I have some vague memory of them doing,
doing styling in a very particular way.
I don't remember what, though, so.
Let's see if I can find some, some example here.
This is great content for the people listening,
just listening to me browsing the web over here.
No, I can't find an example, but anyway.
I know there's been some attempts of doing,
like, another style of--
- I mean, I guess that's the thing, is that you,
I suppose a lot of the frame, the sort of systems
and frameworks we have for CSS, in a way of sort of trying
to achieve something like this, by sort of then writing
their own sort of language, sort of,
which is then turned into CSS, and that probably,
to some extent, I imagine that might be the best way to go,
'cause it means, like, maybe, I don't know whether
hacking into the way that the actual,
the way it's represented within the browser
would make sense.
Also, I have no idea if browsers represent it
in the same way between them.
- Sure, right, yeah. - Or possibly not,
I don't know, it's-- - Yeah, I have no idea.
- All right, that's all I'll take.
So my unpopular opinion is that ORMs are not the way to go.
The title here, for my unpopular opinion, is ORMs are shit,
just use SQL, but it's, I don't know if I wanna go that far,
but, so ORMs are, I generally always find them to be,
so for those that don't know, an ORM is,
I think it stands for Object Relational Mapping,
is that right, yeah, and it's basically an abstraction
on top of either SQL or some other database,
and it's supposed to help you interact with your database
in a more convenient way, like handle writing common,
like doing common things, like getting something,
like a row from the database, or updating something,
or deleting something, but I always find them to be lacking
in some way, so I always have to write raw SQL anyway.
- How often though?
- I mean, pretty often. - Really?
- And then also, I often find myself doing,
so for example, on the New Svelte Society website,
there's a, so I'm using SQLite, and the search is powered
by a SQLite extension called Full Text Search 5,
which is relying on a virtual table.
And in the ORMs that I've been using,
I can't do anything with virtual tables
because the concept doesn't exist.
So that's one limitation.
Sure, I don't have to do that much work
with the virtual table or anything,
but still, just like having to,
like in, so for example, I was using Drizzle,
and then you define your table in like a JavaScript,
like const users equals Drizzle, blah, blah, blah, blah.
You define the columns and stuff,
but then there's no way to do it for virtual tables,
so then I have to write SQL manually anyway,
and then have to manually enter, make it,
like go into the database, for example, and.
- So I mean, back in Rails days, it had Datamapper,
and I was like, oh, I love this,
'cause I did use to write SQL, and it's also where,
there was, I mean, that was also, there was back then,
SQL injection was a huge risk and problem,
and I think it still is when you're,
it's easy to accidentally do it.
- I think if you do it correctly.
- Yeah.
- But that's the thing, right?
But I also think that the tools nowadays are a bit better.
- Well, there was also, I mean, SQL injection
was like the easy bug in some ways,
but there was also a big problem where,
say for instance, where people would do things
where it's like find orders for this customer ID,
but they were kind of, they weren't always checking
that the customer ID that was being sent for that
was the same as the logged in person, and things like that.
- You get someone else's orders.
- Yeah, and so Rails, I think,
made a lot of those sorts of things
where there was sort of a lot of examples on that,
but also sort of making it easier to be like
sort of adding on kind of relational kind of mappings
like that.
- No, I, so, to be clear--
- Search, text search is a bit of a strange one.
I mean, it's like--
- It is, yeah.
- Bit of me is kind of like, well,
you could just use Solr or something like that anyway.
- Well, it's one example.
Another one would be like Triggers in SQLite, for example.
Can't write that in an ORM.
- I don't know if you can, well, also I use Prisma,
and it's very--
- Like, I love the way that you define tables in Prisma.
Like, I really like it, it's much cleaner
than the SQL way of doing it.
But yeah, and then there's, like,
you're relying on them implementing everything correctly
and like mashing together the transactions correctly,
and then you end up in some weird bug.
So I recently stress tested the Svelte Society website,
the upcoming one, and I added, I think,
two million rows into the database,
just to see, can I actually fetch stuff
without lagging the website?
And it was very easy to do that.
And with SQL, I had more control.
I could do, like, explain query plans.
I could see, like, oh, how does the SQLite engine
actually think about this, and what's it gonna do?
Oh, I need an index here, so I'll add an index,
and then fix, like, the performance issue I was having.
Stuff like that, hard to do with an ORM.
I mean, you can obviously, like, combine,
but you don't really know what the ORM is doing, right?
Under the hood.
- I don't know, I'm pretty happy with Prisma.
I mean, I feel like I do, you can ask it
to print out what it's actually doing.
- Okay, yeah, oh, that's good, that's good.
- So, I mean, I think also because of the,
I mean, because of the typing as well, it's nice.
- Yeah, the typing is a big one, yeah, for sure.
- But there have been some strange things.
I mean, I know, 'cause Prisma has its own kind of model
around, it's been a little while since I've used it as well,
but it was kind of like, it has its own model
around how transactions happen.
So I think there might be some things
where I've kind of been like, well,
based on, you know, this is an internal app,
and we've only got a few thousand people tops using it.
The chance of like, in that tiny millisecond
between, you know, you've kind of committed this thing
and then you go and fetch it back or something like that,
you know, it's changed.
Whereas, you know, as a purist, I would be like,
there's probably a way to write this in a single transaction
or something.
I don't know even that, did I mention it?
I can't remember, but certainly there, yeah,
the transaction model is slightly different
because it has to sort of map across different databases.
So--
- I mean, that complicates things quite a bit, I guess.
- Well, I feel like I might have to look at it again
as to whether there is actually, whether it was,
I can't remember whether it was an actual problem
or it was just that it was kind of different
from how I would have done it if I didn't have Prisma.
- Right.
- But I'm not aware of any problems occurring
as a result of it ever.
But I see what you mean.
I mean, I think it depends how much kind of crud-like stuff
you're doing, 'cause I mean, some people,
you have those kinds of things where you're just like,
you've got loads and loads and loads of tables
and you're like, oh, the thing is just about shunting it
back and forth.
- Right.
- And that kind of thing.
So just for the sort of like, typing alone.
And then also, migrations are really,
I think they're quite nice, generally.
- I don't think they're too hard writing yourself.
- Yeah, I mean, I'm not saying, I think,
you can definitely be too small for an ORM to be worth it.
- Yeah.
- I mean, or I think, well, back with Rails as well,
because it was built in and so you were just kind of like,
data map was just there and you just used it.
- Yeah.
- And there was, I think Rails had a really good sweet spot
for, I mean, actually, it's interesting,
because SvelteKit hasn't really kind of gone in
or taken any particular opinion, I don't think, on this yet.
Or maybe it won't do, I think it probably won't.
- I think it will.
- Oh, you think it will?
Oh, okay, well, that would be interesting.
But because there was that sort of thing with Rails
where your sort of initial scaffold would be kind of like,
it would make a little table that was sort of editable
and sort of mapped to a database table.
- Yep.
- And that does cover an awful lot of kind of apps
where it is just kind of taking things in and out of a table
and sort of validating them at some point
and things like that.
So yeah, I think Rails is still going very strong as well.
I mean, I think there's a sort of an alignment there,
actually, in that Rails never became a big,
a dominant kind of player, but it was very influential.
- Then you have Laravel, which is pretty big, I think.
- Well, to be honest, Rails probably is quite big.
- It's hard to know, yeah.
- I think it's bigger than we think it is.
- It's just very hard sometimes to estimate
how much these things are. - Yeah, I agree.
- 'Cause I know as well, I go to, I don't so much now,
but I used to go to an awful lot of hackathons.
And it was always like, it was through the Rails community,
so I was always going along.
It was all these sort of like other people doing Rails
and stuff like that.
And we'd meet people who were doing Python and Django as well
and sort of like go back and forth a bit about that.
But it always felt like it was probably the same people.
And then sometime I went to this hackathon at Microsoft
and it was all these people who were doing .NET.
- Yeah, yeah.
- And they were just, they were so different
and we'd like knew nothing.
We were just like in totally different sort of like
what you were thinking about and their approach to stuff.
It was weird it made me realize how, you know,
the differences between what we were talking about
with the Python people was so minor relatively
as to how we were sort of approaching things.
- Yeah.
Yeah, no, I mean I, maybe I should give ORMs another chance.
I do not like them though, but.
- Yeah, oh, so you've been using Prisma?
- Yeah, for a bit.
Prisma and then Drizzle.
- I haven't tried Drizzle, so.
- It's similar, but yeah.
- Maybe, I don't know, maybe I need to be
doing weird things with them so that I start to hate them too.
When you realize what you can do with SQL, wow.
- Yeah, well.
- I mean you could do field validation in SQL, right?
And raise exceptions.
- You can also do some really weird things in SQL.
- I mean that is very weird to do field validation
and raise an exception at that, yeah.
- But even just like,
some of the databases support it natively,
but like trees in SQL are really weird.
Where, you know, you're kind of like being like,
well I want to sort of select all of the sub-trees of this
and people can do these really bizarre queries
and kind of do it and sort of flatten it all out
and bring it back.
But you're like, it's just.
- Unreadable.
- Yeah, it's, I mean, I think 'cause I know for a while
Oracle was one of the few that did support
this sort of idea of trees, but I bet Postgres does it now.
- Probably, I feel like Postgres supports everything now.
- Yeah.
(laughing)
- You know, I never really,
so the thing about using SQLite
is that you kind of escape the N plus one problem
where like, you know, in a client server paradigm
you have to go back and forth over the network.
Even if the server is local on the same server,
you're still going through the network
'cause you're, that's how it works.
But with SQLite, you just have a file
and you can just like write.
- Oh, 'cause you're just going through.
- Yeah, you can just write very small readable queries
and just like do it sequentially
and you'll see like, oh, I'm getting the content,
I'm getting the tags for the content
and I'm putting them together or whatever it might be, right?
So maybe that's a reason why I don't feel like I need ORMs
because the queries that I write are very, very simple.
- I think as long as you're not having security problems
then it's probably okay.
- Yeah.
- And you could, I know there's definitely tools,
sort of lighter weight tools which will kind of ensure
that things are escaped and things like that.
- Yes, yeah, yeah, I think most clients do that now
if you use it correctly.
- Yeah, yeah, 'cause I think that was the scary thing
where people were just concatenating strings
in kind of bad ways. - Yes, yeah.
- And yeah, I've definitely made some bugs like that
in the past and definitely found some and things like that.
- We'll see when the new Svelte Society website goes live.
We'll see how long it takes before we're hacked.
- Okay, all right.
But yeah, all right, Pix, do you have one?
- Wait, I forgot now, I was trying to think of something.
Do you have one?
- I was gonna say SequelLite,
but I've been talking about SequelLite for so long now
so I'm just gonna say London.
It's a very nice city.
I like coming here, it's great.
- Well, this is a technology one which is interesting.
It was at the London Svelte chat and I've forgotten his name
but I've only just, it is a public repo
but there's this library called GUI, G-O-M-E-Y.
- Oh, you're talking about Brady?
- Yes, I said Brady's and I really like it.
So it's a kind of sort of thing for fiddling around
with the properties of things.
So I've been using Svelte tweak pane previous to this.
Well, actually let's say I'm still using Svelte tweak pane
'cause I've only looked at GUI and been like,
oh, this is interesting. - Sorry, what's Svelte tweak?
- Tweak pane. - Tweak pane, all right.
- So I would highly recommend Svelte tweak pane.
There's no, but he had been using that
and it was essentially, he has some very, very fancy
kind of audio and sort of visual kind of,
the tools that he's built and sort of that,
he needs a lot of kind of custom and sort of complex
kind of abilities to tweak it.
So I mean, also I'd say to any of the listeners
that it's a bit like if you've used DAT GUI,
which was a popular thing that the Google Data Arts team
made, but it's one of these sorts of things.
- So like digital audio converter, DAT?
- I think, I don't know what it stood for.
I think it might've just been like DAT.
- Is it D-A-C? - Yeah, D-A-T.
- D-A-T, oh, oh. - Yeah, I don't know,
like that, I don't know whether,
or maybe it did start for a digital arts team, maybe.
It's probably a digital arts team.
- I misheard.
I thought you said DAT, like a digital audio converter.
- I don't know, I think they also copied it
from somewhere else, but it's one of these things,
you know, where you see in a lot of languages
and programming things where sort of the ability
to tweak the values of things.
And yes, I've felt tweaked pain.
I love, use it a lot, but I will be investigating GUI
because it looked, and particularly as well,
because I have reached, which Brady was saying,
that I've reached that point where it's sort of,
sometimes I'm like, I want to make my own
interfaces to things, like it was a thing
where I wanted to have a sort of weird sort of
change in your relative position in time.
- Right, right. - And things like that, yeah,
'cause, you know, all the problems with times and time zones.
- Oh, right, I am very well aware of time zone issues.
- Actually, that was an interesting thing
which I probably don't know enough about yet,
but there was that proposal, or maybe it's even more,
is perhaps a further stage than that,
but the sort of new JavaScript,
sort of time and time zone combined.
- Yeah, it's called Moment?
No, that's the library. - Oh, sorry, that is called--
- It's called a-- - Temporal.
- Temporal, that's what we're doing.
- Yeah, 'cause actually, interestingly,
other colleagues at Bloomberg worked on it.
I don't know which ones are,
but they were the others on the initial proposals.
But yeah, it does, it's definitely something
that has been quite bad in JavaScript,
so I look forward to better things.
But I mean, a lot of it as well is just,
you realize how fundamentally complex
time and time zones are.
- Yes, yeah, and the fact that there are, like,
time zones where the difference is like 15 minutes,
or 30 minutes, instead of an hour, which is what you--
- Actually, this would pop into the controversial things,
which I need to understand somebody,
to talk with someone who understands it better.
But you know there's also this problem with leap seconds?
We did a graphic on this ages ago.
And so, 'cause we've been adding leap seconds a bit,
so I can't remember how, they'll be, like,
15 seconds ahead now, or something like that, of UTC.
But I'm like, one of the things I wondered is,
can we not just put,
why can't we just let the leap seconds
be applied to time zones, or something like that?
It feels like, 'cause time zones are already weird,
so it feels like it would be better--
- Just put the weird stuff in the time zones.
- Yeah, and then to just be like, UTC would just,
I mean, the thing I've realized now is they're saying
they can't really get rid of the 15 seconds either,
so there's this, like, gap between UTC
and the POSIX time step.
- Isn't there something about leap, the leap,
there's something about, like, how,
if we would have made the year 13 months and 28 days
or something, then it would just have been, like,
perfect, something like that.
- Oh, really?
- Yeah.
- Well, at some point it's kind of a problem, isn't it?
'Cause the Earth is slowing down.
- Well, sure.
- 'Cause there's some examples, like, half of it,
they were like, this was to theoretically
please astronomers, and astronomers are like,
oh, we don't use any of that anyway,
because it's completely--
- Right, it doesn't matter.
- They do something a bit like POSIX numbers anyway,
just with their own atomic clock.
- Like SI unit, but for time or whatever, yeah.
- But it's interesting with alternative calendars.
I mean, it's interesting, actually, a lot of those,
there's support for other calendars in,
already, I think, in JavaScript.
- I mean, there are other calendars, right?
You have the, like, the, is it Arabic or Islamic calendar
or something like that?
I don't remember what it's called, but.
- But yeah, and we're not really,
I don't know how many people
were sort of organized day to day on those,
'cause as I understand as well,
this is sort of a weird sort of Wikipedia dive
from ages ago, but the Kodak Eastman company
apparently internally used their own calendar system
until, like, the late '60s or something like that,
and you're just like, wow, that must have been so strange.
- That's wild.
- That you would go to work,
and there would be 13 months at work,
and there's only sort of 12.
- Does that mean, then, that maybe,
maybe there were a lot of different calendars
that people were using that weren't, like, standard?
- Yeah, quite possibly, yeah.
- It was just like, oh, at this company,
we used this weird calendar because.
- It feels strange that we haven't,
it feels weird that if Kodak were kind of
trying to advance things, they were sort of like saying,
this is, we think that this calendar
is gonna be better for our business needs
or something like that.
I mean, I suppose with that, we've found
that it's very hard, an improvement
has to be really significant to be worth
the kind of costs of the adaptation.
And I think also the trouble with it
is it's like, it's unfamiliarity with it.
And because I, with that, I mean,
I'm like the kind of chaotic person
who could be like, let's change everything.
I'd quite like us to change to a dozen
or a number-based system instead of decimal.
But I think that one's really fun now.
- Yeah, that's probably not gonna happen.
All right, and on that note, I guess we're done.
Unless you have something else.
- No, I think that's a perfect way to end it.
- All right, it was great having you on as a guest.
Well, actually, I'm at your place,
so thank you for having me.
- neutral guests, yeah.
- And to all the listeners, you will find
all the links in the show notes,
and I will see you again next time.
Not, probably not next week, but next time.
Bye bye.
- Hey, it's Kev here.
If you like the show, please drop a review
on your favorite podcast player, it would help out a lot.