Hacker News new | past | comments | ask | show | jobs | submit | j13n's comments login

This is the second post I’ve seen praising Datastar in the last 24 hours, and once again no mention of the requirement to punch a gaping hole in one’s Content-Security-Policy.

If this is the framework of the future, cyber criminals are going to have a bright future!


That's the nature of anything that does this kind of work. React, Svelte, Solid. Alpine has a CSP version but it does so little that I recommend you just accept being a Web1 MPA basic site.

I have ideas around ways around this but it's a per language template middleware.


Alpine CSP version works fine. You just can't write JS code in strings, which one may wish to avoid anyway.

I also didn't have a problem with CSP and HTMX.

Nor with SvelteKit.

I'm not sure why you think these are all equivalent to DataStar's hard requirement on unsafe-eval.

FYI, this is the reason I didn't try out DataStar.


Svelte only requires a CSP hole in its default config as a standalone library; SvelteKit does proper CSP by default, and if you're not using SvelteKit you can build CSP handling into whatever you are using instead. I assume the others are the same way.


Could you avoid eval by having a CSP mode that forces reactive expressions to only allow functions users have registered with datastar in a lookup table?


Is there anything I could read detailed explanation of issue, in particular w.r.t datastar?


Please don't cargo cult CSP without understanding it.

unsafe-eval constrained to function constructors without inline scripts is only a concern if you are rendering user submitted HTML (most common case I see is markdown). Regardless of your CSP configuration you should be sanitizing that user submitted HTML anyway.


How does this compare to HTMX (security wise)?


Same, you control your signals and fragments. So you are responsible for proper escaping and thoughtful design.


You can disable all use of eval with htmx. The tradeoff is one has to write a bit more JavaScript.

https://news.ycombinator.com/item?id=43650921


I have thoughts about a fully compliant CSP middleware, problem is it's per language so I'd probably only make for Go (maybe PHP & TS)


Hashes or nonces?


Hashed script content


Thank you for doing this. Is it possible to follow the work somewhere?


Not right now. CSP in a Datastar context is mostly a red herring. If an enterprise wants it to check a box then please reach out.


I don't represent an enterprise; just a dev. It would make it easier to sell the idea of Datastar to clients if it was compatible with strict CSP.


could you please elaborate on this?


The linked post relies on the Datastar project, which requires use of `unsafe-eval` in one’s Content-Security-Policy [1]:

> When using a Content Security Policy (CSP), unsafe-eval must be allowed for scripts, since Datastar evaluates expressions using an IIFE (Immediately Invoked Function Expression).

The project itself links to Mozilla’s docs on CSP, which state:

> The unsafe-eval keyword can be used to override this behavior, and as with unsafe-inline, and for the same reasons: developers should avoid unsafe-eval.

Out of the box, htmx uses a similar approach, but one can disable this use of eval [2]:

  htmx.config.allowEval - can be set to false to disable all features of htmx that rely on eval:
  
  - event filters
  - hx-on: attributes
  - hx-vals with the js: prefix
  - hx-headers with the js: prefix
[1]: https://github.com/starfederation/datastar/blob/develop/site...

[2]: https://htmx.org/docs/#configuration-options


I love innovation in this space, and remember when Parinfer came out having some enlightening discussions with colleagues about how they efficiently edited code.

I've since settled on Lispy and Lispyville in Emacs, and have run into very few issues over the past few years.

There's something about Lispy’s style of editing that appeals to me — the use of hugging parentheses to enable its bindings, combined with Lispyville making all of my Vim bindings safe, makes me very happy.


A scalar field is a field with one value at any point.

Temperature can be represented using a scalar field. There is only one temperature at any point in our universe.

Theories like Quantum Field Theory describe our universe as a series of interacting fields that are everywhere. The Higgs field gives us mass, a single number at any point in space.

In this sense, the space around us is permeated by many fields.

Space itself is not a single scalar field because space contains many properties at every point that cannot be represented using a single number — for that one might use a matrix of values.

https://en.wikipedia.org/wiki/Scalar_field


Temperature seems like a bad example because its an average of energy in particles in a volume of space. The temperature at any finite point will always be zero. Like what's the temperature on the inside a neutron? Is that even mean anything?


Wait, why would the temperature at any finite point will always be zero? Because I’m quite confident it would be non zero as emptying space is stupid expensive.

And there is temperature inside a neutron, since it’s not a fundamental particle but composed of quarks: The neutron temperature T, on the Kelvin scale, is given by T = 2E/3k, where E is average neutron energy and k the Boltzmann constant.

Source: https://www.oxfordreference.com/display/10.1093/oi/authority....


> why would the temperature at any finite point will always be zero

Based on your answer of the temperature inside a neutron then maybe it won't be zero everywhere. Any finite point is going to either be inside a particle or outside of a particle. And since most of space is empty, and atoms are also mostly empty, the vast majority of finite points will be where there is nothing, and hence have no temperature.

> emptying space is stupid expensive

I don't what this means. Most of space is already empty.


If space is “empty”, then how come we can measure the temperature of the microwave background radiation?

Think about it…any direction we point an apparatus, we will get a reading — the static of a radio IS the CMB, and if you could take that radio into space, and have the ability to travel anywhere, that radio would still have static. As such, space cannot be “empty”, it’s filled with photons, electrons, and quarks, amongst other things.

To reach 0 Kelvin would take an infinite amount of energy (infinite is not exactly accurate but might as well be), hence “stupid expensive”. It would also create holes in the CMB. CMB has no holes, as such, there is stuff everywhere.

Does that track?


> how come we can measure the temperature of the microwave background radiation

Because that's the average temperature over an region not the temperature of a finite point. It's kind of like pressure; it really only makes sense at a macro level where you are averaging over a volume or region. The pressure at a singular finite point will also be zero because that singular infinitely small point will likely be in the empty space that makes up an atom.

The original comment was about scalar fields in which there is a value at every finite point. Temperature and pressure are not good examples of these. A better example would be like a magnetic or gravitational field which would have a specific value at every point in space.


> since most of space is empty

Empty space is still busy fucking around with itself [1].

[1] https://en.m.wikipedia.org/wiki/Vacuum_energy


It’s great to see reports of the excellent work Daniel Slutsky and others are doing to make data science more straightforward for everyone.

I'm grateful that I get to benefit from these community efforts.


Good luck getting academics to adopt anything they don't know about, and all they know about is Python.


This is a strange comment that probably reflects the sliver of academics you're familiar with. Who do you think wrote and continues to develop R and all those packages? There are actually many types of software in use by academics.


Probably true.


Academics is much older than Python. At some point, they adopted that.


Academics (the mass noun, meaning something similar to "academia") does indeed learn and progress. Academics (the worker bees in the academic hive) can be super intransigent and in my experience learn a couple of tools in their younger days and never again. As they say, science advances one funeral at a time. I've found that new ideas and technologies are almost always brought in by new students, and not old academic dogs learning new technological tricks.


> can be super intransigent

I learned a new word today.

And I agree, but the end might be a bit optimistic at how often or efficiently that happens. In my experience, most are all too willing to accept the institutionalized choices.


There are actually a surprising number of academics in the Clojure for data science study groups. A lot of them ran into performance or portability issues with Python or R and found Clojure tools as a good solution.


Nueva Pescanova is already sizing up cages.

https://www.bbc.co.uk/news/science-environment-59667645


> Nueva Pescanova is already sizing up cages.

Please don't make false accusations about a third part without a minimum understanding of the matter first.

Nueva Pescanova has nothing to do with this case, and I doubt that they would be interested at all in breeding a deep sea (and, most probably, non edible) species.


Come now, it wouldn’t be a normal HN conversation on octopuses if we didn’t debate whether to eat them or not.


Nothing to do with the controversy, just curious: Why would deep-sea octopuses not be edible?


Deep sea cephalopods accumulate ammonia in their body as a buoyant device. This way, they don't need to spend so much energy swimming. Ammonia is fairly toxic, so they would taste either like pee, or like poison. I had touched some of this animals and the smell of rancid fat and urine last for days in your hands

Also if you put this animals at the surface they will literally burst from inside and turn into a mushy mess. I had explained this yet a few times before, but for some reason this particular Muusoctopus nursery is a recurrent history on HN.

Octopuses are benthic, so they could store a different amount of ammonia, but my bet would be that such partially disintegrated octopus product would look and taste awful. None of the other species of deep sea octopuses are fished commercially.


Joke's on you, we're into that:

Hongeo-hoe is a type of fermented fish dish from Korea's Jeolla province. Hongeo-hoe is made from skate and emits a very strong, characteristic ammonia-like odor

Skates (hongeo) are cartilaginous fish that excrete uric acid through the skin, rather than by urinating as other animals do. As they ferment, ammonia is produced, which helps preserve the flesh and gives the fish its distinctive, powerful odor.

https://en.m.wikipedia.org/wiki/Hongeo-hoe


I know that some sharks and rays had a more or less strong pee taste. I personally dislike it. Skate is the only dish that I would classify as dog food grade. The line between tasty and nasty is very thin in those fishes and requires a skilled chef.

But I'm perfectly fine with the idea of some people loving the pee taste, or eating rotten shark meat, or urinating in other people's mouths while eating carp croquettes. As long as those people is not me, good for them. I'll pass. Thank you.

Feel free to eat this new discovered octopus before any other human and tell us about your experience. My bet is that will be memorable for all the wrong reasons

In any case, skate meat should be forbidden by conservation issues. Their populations are very fragile and on a sharp decline, and to eat this animals is very irresponsible.


I just wanted to say I thoroughly appreciate your contribution to this thread. Equal parts intellectually interesting and belly-laugh worthy


Wait, that can't be right, you must be talking about some particular species, they're everywhere in Briti-- oh. Common Skate is critically endangered.

It's also about £8.50 for 500g.

ffs. We are, collectively, utter morons aren't we?


The ammonia content of Greenland Shark doesn't prevent them from being a treat:

The traditional method begins with gutting and beheading a shark and placing it in a shallow hole dug in gravelly sand, with the cleaned cavity resting on a small mound of sand. The shark is then covered with sand and gravel, and stones are placed on top of the sand in order to press the fluids out of the body. The shark ferments in this fashion for six to twelve weeks, depending on the season. Following this curing period, the shark is cut into strips and hung to dry for several months. During this drying period, a brown crust will develop, which is removed prior to cutting the shark into small pieces and serving.

https://en.wikipedia.org/wiki/H%C3%A1karl


From your link:

> Those new to it [Hákarl] may gag involuntarily at the first attempt to eat it because of the high ammonia content.


I think its pretty obvious the comment you are replying to was a joke.


TYFYS, doing your part to Stop The Spread of dis-and-or-misinformation!

I usually accept any given internet comment as unimpeachable truth, and was just about to fire off a bunch of angry hate mail to Nueva Pescanova because of this specific thing!

Gosh, would I have felt silly to find out that they're not literally building cages for this particular species!

Do you have a source for your claim that nobody in this company is currently planning to build cages 10,000' underwater for a species that was just discovered?


I find it weird that people won't eat meat and poultry, but still eat fish and seafood and sometimes cite environmental reasons.

Most fish are caught and some sea based farming efforts have been pretty terrible for the environment.

I reckon if you want to eat meat still you should mostly be eating chicken.


"I reckon if you want to eat meat still you should mostly be eating chicken. "

But favorably chicken that has seen the sun and real soil to pick in, not only on the way to the slaughterhouse.

And there is nothing inheritently wrong with fishing, it is just that the way it is usually done, is quite horrific. But there is somewhat certified ethical fishing. Or local fishermen.


The massive problem with fishing is that the fish are wild. They need to get replaced by nature. You can’t scale up the operation. Add to that pollution, warming seas, and you’re disturbing a system way too much.

What’s the plan once the oceans are messed up permanently?

At this moment, I think factory farmed chicken would have less impact on the environment.


The oceans are huge.

When you are not overfishing and destroying the ground with bad trawling, where is the problem?

(But yes, it is a problem, that both is done)

The oceans warming is a separate problem.

And I like fish as well as chicken as well as beef. But I don't have to eat it every day.


At this point wouldn’t it be easier to artificially select for traits that make the chicken mind more tolerant of poor conditions? Like if we can have consciousless chicken then it wouldn’t matter the condition they grow under?


Hitchhiker's Guide to the Galaxy has you covered here, with sentient cows engineered to be ecstatic about the thought of being killed for meat.


This seems problematic in a different way.


It sounds way easier, to continue to pretend, that animals don't have feelings. And in general not know too much of the meat factories. Which is why many people choose this approach.

Also like the sibling comment said, not really possible with our tech and knowledge. Lab grown meat would be the way to go to achieve it.



That is one heck of a story. Salient to discussion about consciousness: to what extent does the ability to act like awareness, count as awareness for the purposes of outside observers?


This guy is way ahead of you: https://www.wired.com/2012/02/headless-chicken-solution/

I imagine the meat would be pretty tasteless though.


You would need a clearer working model of consciousnes to be able to know whether your efforts were succeeding. But this is the idea behind lab-grown meat, just don't grow the brain at all and you don't have to worry as much.


There are other reasons than environmental for eating fish but not meat.

I used to be pescatarian and my main reason for that was factory farming. Once reason I now eat meat is that it has become a lot easier to buy meat that has been well treated.


Before I was a programmer, I was a marine biologist and also worked as a fish farmer.

By virtually all metrics, intensive land-based animal farming is much harder on the environment. Also, in terms of animal welfare, its super sketchy even with animals labeled organic.

The misinformation around fish farming is absurd. I think people want to believe in the myth that commercial fishing is a couple guys in a wooden boat; when its actually a floating factory discarding up to half or more of what it kills.

There are many aquatic things I won't eat but mostly it is of the "wild fish" variety (overfishing, pollution, mercury, bycatch). I worked a single season as a fisheries observer in Alaska. The destruction was maddening.

I put wild fish in quotes because many times they are raised in a hatcheries then released into the wild. Which has ruined the gene pool of salmon in places that do this.

After a few years raising chickens at my home farm, I became pescatarian. I drew an arbitrary line at intelligence where I wouldn't eat anything as smart or smarter than a chicken.

Anyhow, avoiding farmed fish while eating land meat is really misinformed. I think the meat industry and commercial fishing industries have managed to completely misinform the American public (and a few well-meaning but misleading documentaries on the subject).

America doesn't not farm very many aquatic things besides oysters, trout and catfish. Which are all very very green industries. I like to bring these ones up in conversations about this topic.


At the moment my line of thinking is “what’s easier to engineer around?”

I’m not saying we should eat “land meat”. I’m saying specifically chicken. I believe they are the most cost effective of the meats.

Of the farmed fish, did you single out trout and catfish because they are green, or has the industry in general improved?


I think it's more to do with us being able to empathize more easily with other land animals because we're biologically similar. Fish can't scream in pain or show basically any emotion we'd recognize at all. They're so different it's like looking at a wiggling steak, so it's trivial to dismiss them as simple automatons.


It takes some effort, but you can buy responsibly raised/caught seafood. https://www.seafoodwatch.org/recommendations/download-consum...


because people feel less close from fish and seashell than birds, and less close than birds than mammals.


I refuse to eat Octopus based on its level of sentience.

I regularly eat pig despite a higher level of sentience. And despite having had far more interactions with pigs compared to Octopus.

Point being, we humans really are not rational with our food choices.


>Most fish are caught

Overfishing aside, I guess you would most often find people that believe hunting /fishing for your food is more ethical than farming it


Which is absurd when you realize that commercial fishing kills up to half or more than what it catches.


Hunting/fishing for food was really more ethical many millennia ago, when humans were fewer than wild terrestrial vertebrates.

Nowadays, there are many more humans and domestic animals than wild terrestrial vertebrates, so hunting could not sustain any non-negligible fraction of the humans.

The modern methods of fishing are much too wasteful, so neither fishing has any future.


From an ecological perspective, farming is probably better than fishing wild species no?


Nah fishing wild is better assuming your catch rate is sustainable for the population. Farming means taking acres of natural area with a careful web of ecological interactions that took millions of years to develop as such, and replacing all of that with a temperamental monocrop sometimes as far as the eye can see. It would be like if we fished by first sterilizing the ocean and then growing up some goldfish.


[flagged]


You first buddy.


I've had a to-do item to build a collaborative AR experience for people to graffiti the world and find the creations of others.

I picked up the domain OutHere and spent some time drafting the initial experience because I think it's a compelling idea, but life has gotten in the way of late.


The current trend of projecting information onto our eyes through devices is a primitive form of sensory enhancement.

It is time to make a leap towards a more transformative innovation, which could be achieved by transmitting knowledge directly into our brains. This way, we could simply know the name of a plant by looking at it.

Reading is primarily about acquiring knowledge. I am personally excited about the idea of augmented intelligence, which would not require strapping a couple of TVs to our faces.


See, the nice thing of AR glasses is that you can use them without tampering with the brain, and you can also take them off.


Mission accomplished! Happy to hear it.


Is this better or worse than laughing at your jokes?


only if they're funny


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: