Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Marton Sari
@sarimarton
so the target is being able to put an ENTER, type '<MyFancePanel>', put another newline, type '</MyFancePanel>' and being sure nothing breaks
That's my criterion of 'supporting componentization'
brucou
@brucou
and the problem is that the syntax which you write does not reflect the function that is the component. If you have a hidden context variable, then of course, you optimize for the components in the tree which are not dependent on that context (you don't have to repeat that variable all the time) but it makes it harder to understand the behaviour of your tree. You need at some point to understand what is this context.
Easy to write, true, but not easy to read in my opinion
Marton Sari
@sarimarton
I'm fine with having lenses in the tree, I see them
I don't have a problem with the fact that a JSX child depends on its context, that's normal. It can depend on a carefully prepared lens to shape the state to its flavor
But there's a big difference of opting-in to modify the context, or having to define the context on every level
brucou
@brucou
I read a bunch of React code where you have more or less App = <Header><Body><Footer>. Terse, but apart from the fact that there is a header and a footer and a body, I can't really say anything else without looking at the implementation of each. For sure, it may not be a big deal, at the end of the day anyways you will have to look at some point at the implementation. But anyways that is react. I am looking forward o seeing how you make this work with powerC
Marton Sari
@sarimarton
It's already done
That was my goal, to have this kind of terse structure in JSX
brucou
@brucou
no I mean reaching an interface which is simple enough to bring picky developers in the frp wagon.
honestly I think it is quite the improvement
but I still think there is some complexity that can be reduced.
Marton Sari
@sarimarton
Ah yeah, I'm not that optimistic, but I feel it's worth to pursue, and I'm just lucky enough to have capacity to work on it. A lot of marketing thing would be needed too maybe

but I still think there is some complexity that can be reduced.

Yeah! My experience was that I was always just took the low hanging fruits. And because its FP, everything is composable, it's easy to introduce new and new shortcuts. It's just function composition. With some syntactic help, but basically they're also function compositions

The code of powercycle itself is very functional too, there's hardly any imperative part
brucou
@brucou
well with enough marketing you can sell anything. But I mean I look at Svelte, and it is not like they have so much marketing, or a great time, or belong to any large company, it is Rich and two other guys I think. But it has faithful followers because the benefits are there and obvious.
Marton Sari
@sarimarton
Hmm, yeah, maybe
brucou
@brucou
well that and the fact that Rich actually have over many years developed all the pieces that he needed (he made a bundler (rollup), he made a parser, and he had the experience for authoring Ractive, another framework). Svelte looks like a new thing, but in fact most of the work comes from previous work.
The key issue with programming with streams is the streams part, not the programming part.
So in front of that disadvantage, you have to put some obvious benefits to compensate
Marton Sari
@sarimarton
What's wrong with streams? Evan Czaplicki also ditched streams in Elm
Why is this? They're just monads
brucou
@brucou
don't ask me, ask those who don't want to learn it
Marton Sari
@sarimarton
They have a higher entry bar, but then you get a better model
brucou
@brucou
after all monads are just monoids in the category of endofunctors or something
Marton Sari
@sarimarton
Svelte now has a lot of contributors
brucou
@brucou
yeah but they come from ractive, the former framework that Rich made. So there has been a spill over. In fact Svelte 1 was Ractive + compiler.
Taken from the SICP book:
Stream processing lets us model systems that have state without
ever using assignment or mutable data. is has important implications,
both theoretical and practical, because we can build models that avoid
the drawbacks inherent in introducing assignment. On the other hand,
the stream framework raises difficulties of its own, and the question
of which modeling technique leads to more modular and more easily
maintained systems remains open.
Marton Sari
@sarimarton
When I got to the part 'On the other hand', I expected something more palpable to come
brucou
@brucou
ah ah
well the book is 800+ pages
and the information about streams is scattered on many pages.
Marton Sari
@sarimarton
What's the exact title?
brucou
@brucou
that
well if it uploads
Marton Sari
@sarimarton
oh
I see
Structure and Interpretation of Computer Programs
Wowowow, thanks!
In the name of everybody :D
brucou
@brucou
download it now so I can remove it from here
Marton Sari
@sarimarton
I did it already
brucou
@brucou
ok
brucou
@brucou
so it is not in the name of everybody it is just in your name ah ah
ok I am going to bed.
If you ever start to do the chess example, let me know. It is pretty simple, but if you have questions, I should be able to answer them.
Marton Sari
@sarimarton
okay (y)
brucou
@brucou
well I can't resist, I leave you with an example of code from Lucid, which a functional language which is completely stream based. It is in one of my old articles where I explain the three functional models for reactive programming (https://brucou.github.io/documentation/v1/contributed/User%20interfaces%20as%20reactive%20systems.html), search for We reproduce here the coffee machine the example is just after that.