Fork me on GitHub
#off-topic
<
2018-08-17
>
Drew Verlee13:08:38

what does bundling mean in the context of coding?

jgh13:08:48

in the context of iOS / macOS it refers to the app bundle which is basically a directory with a specific layout

Drew Verlee13:08:34

what about this context then: https://stackoverflow.com/questions/47053316/what-is-the-react-native-webserver-and-why-is-it-needed >react-native start command like you can see starts a web server. Th purpose of this webserver is to bundle your javascript code and serve it while you are in development mode

Drew Verlee13:08:51

and thanks for the help

jgh13:08:45

oh, im less familiar with frontend development but i know that certain frameworks require a "compilation" step that basically merges / minifies javascript and moves other resources into the right place.

jgh13:08:55

so maybe this webserver does a lighter version of that?

3Jane13:08:47

basically, yeah

3Jane13:08:37

While developing, you will have a crapton of small files, but browsers don’t allow you to download a crapton of files at the same time

☝️ 4
3Jane13:08:52

so an automated tool concatenates them all into a single file.

3Jane13:08:07

basically a tar, everything old is new again

3Jane13:08:23

and then if you stretch the metaphor, minification is a gzip equivalent 😄

3Jane13:08:07

(this is the same reason as why people create a single large image file which is like a mosaic of smaller images, and then use css to display tiny slices of the mosaic where smaller images would normally go)

3Jane13:08:40

There’s a constant race to make your website both performant and responsive as early as possible; and people control this via how many, and how large the linked files are.

3Jane13:08:10

For example, ages ago, when the internet was SLOW, it was in vogue to cut up the large images into a number of smaller ones, so that they would load concurrently. Now the internet is fast and servers don’t like the same client to block X sockets, so people started coalescing smaller images into one large image, as I described above.

3Jane13:08:34

And as a completely separate issue, the Javascript (ES, Typescript, whatever) everyone writes these days is not the Javascript that a lot of browsers understand, because of implementation lag and also people don’t upgrade browsers, so you use a transpiler to downgrade to a previous version, essentially.

dominicm19:08:49

I'm trying to implement something akin to macros. I've got it in my head that this is essentially a breadth first search, is that correct? I want my macros to have some ability to defer their evaluation based on adjacent/parent structures in the tree which may be unexpanded as of yet. My solution has been to use a queue, and allow macros to defer themselves and queue their dependencies. I'm using the same solution to perform eager evaluation of parameters too. Does this make sense, or am I missing an alternative architecture for this?

hiredman19:08:03

https://github.com/hiredman/qwerty/blob/master/expand.clj#L313 is part of a compiler based on something like macroexpansion, where the "macro expansion" process did just about everything, including hoisting type declarations top level scope, so expansion passed around environments, one pushing information down the tree, and the other passing information up the tree

hiredman19:08:27

it expands sort of twice, once going down the tree and once coming back up the tree, so a macro could not expand going down the tree, and then expand coming back up if it needed information from down the tree

dominicm19:08:31

I'm doing something a little bit unusual, I have edn like:

{:a #ref [:b]
 :b #join ["a" "b"]}
And I'm trying to make it possible to implement #ref.

hiredman19:08:39

are you familiar with topological sorting?

hiredman19:08:04

what you have is a graph, get a topo sort of the nodes, and then fill in the nodes as you go

dominicm19:08:09

I am, that's how it's currently implemented. The idea is to open up the possibility to do this in an extensible way (without a special mode for just #ref).

dominicm19:08:56

That might be foolish though, and keep ref a special, and layering on a normal macro system makes more sense.

jjttjj20:08:06

hoplon/ui (https://github.com/hoplon/ui) is a library that offers an abstraction over html elements, so that instead of a big pile of dom element types you're given very few, essentially just one single elem type with very flexible attribute system letting you define size of elements and spacing between them, etc. I found it's the only way I've been able to actually succeed in specifying UIs without endless trial and error of css properties, etc. Does anyone know of any other similar attempts at "re imagining html primitives" like this? Not talking about CSS frameworks like bootstrap

jjttjj20:08:35

I guess put another way, I don't think the ease of using hoplon/UI can be accomplished with just css properties, it requires also the composition of elements (it uses a "box model" which uses 3 nested divs per element), and things like adjusting child element properties based on parent element attributes. Does anything like this exist in the javascript world perhaps?

lilactown22:08:38

it sounds like hoplon/ui is using canvas, instead of the DOM?

lilactown22:08:19

many other people have tried such a thing. it suffers from the fact that you now have to re-implement all of HTML and CSS

lilactown22:08:36

things like accessibility usually suffer pretty badly

jjttjj22:08:46

@rakyi very cool! @lilactown It doesn't use canvas but rather builds its element primitive out of actual dom elements, and there are flexible enough attributes to the generic element type to usually in most cases represent all layouts you would build in html/css. Though yeah I'm sure it can't take advantage of some of accessibility stuff, it's more for rendering "Web app" type stuff than documents so I don't think it loses much from losing the semantics of the html elements in practice