Hacker Newsnew | past | comments | ask | show | jobs | submit | saas_co_de's commentslogin

> const selectBy = (table, column, value) => db.query(`SELECT * FROM :table WHERE :column = :value`, {table, column, value})

> const selectOneBy = (table, column, value) => { const res = selectBy(table, column, value); return res && res.shift() }

Two or three lines gives you about 80% of the value in any ORM and avoids the -20% value found in the other 100k LOC.


> Two or three lines gives you about 80% of the value in any ORM and avoids the -20% value found in the other 100k LOC.

I have a hard time believing this when the two lines above are obviously wrong. You can't use :column to escape the name of a column in SQL. So your code has to protect it, which is not easy if you wan't to be portable. MySQL will generally use `column` but may be configured to use the standard "column".

Anyway, selectAllBy() and selectOneBy() are not enough to be confortable. I appreciate the static completion in Something.find({id: 1}).complete, the relative queries like Post.find({id: 1}).author, and many other things that help against typos, help code faster and make the code more readable.

I agree with the OP that fallthroughs are much needed, because writing custom SQL is sometimes simpler, and sometimes much more performant. Usually, its mostly about writing SomeModel.findAllBySql() which most ActiveRecord implementations provide.


[flagged]


Please don't cross into incivility when commenting here, regardless of how right you are or feel you are.

https://news.ycombinator.com/newsguidelines.html


> it's very difficult to identify which layout is most efficient

Don't worry. The compiler will figure it out. And this time the compiler will have AI™.

> the killer is that dead silicon tends to be a LOT of silicon for any given program

Part of the idea here is that the cost dynamic has changed. Silicon is cheap compared to power so even if you have lots of chips not being used at any given time as long as they can be fully powered off total system cost (capex+opex) is still better.

> why it would work this time

The difference is scale. If you are running millions of CPUs and adding 100k's per month then something like this could work, assuming the AI™ magic that figures out which new chips to build.

Intel is talking up their grandiose vision but practically this is the same as AMD's chiplets on active interposers (https://spectrum.ieee.org/tech-talk/semiconductors/design/am...).

The physical technology is real and probably coming soon but it will be limited to incremental improvements to the existing CPU/GPU compute architecture from increasing bandwidth and decreasing latency until the magic compilers arrive.


If I'm understanding you right, what you're suggesting is that the individual silicon modules will be fixed, but they will be contected in a single package in lot's of different ways.

If that's correct I'd love to see the cost of making the trip between the modules. I've got to imagine the cost of that is just huge. The interconnect is also crazy - it's easy to do complex routing tasks on silicon at high performance. I don't know how you acheive that in a scalable fashion between silicon.


> There is very little traffic on sidewalks

lol. i guess the plebs who can't afford uber don't count as people. SF sidewalks have seem pretty packed to me whenever I am there.


It is also extremely expensive ($1.44/hr of audio) which really limits its potential. I looked at it for a project but it just didn't make sense.


I can't imagine many use cases where $1.44/hr is a significant cost.

If you sell audiobooks, then a one off cost of a few dollars to convert the book to audio form is tiny compared to the authorship of the text.

If you are doing something like turn by turn navigation, clips are typically only a few seconds long, so very cheap, and again, many of your users will be needing the same clip, so no need to pay for it twice.


I've been using it for one of my projects but it just requires one-time use of the audio. As in, I use the text to speech to create audio files which I just recycle. Overall, it is more effective compared to using my own voice or hiring a voice over person to do it.


> BlackRock is today the world's largest asset manager with $6.3 trillion in assets under management

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

I think a lot of people would consider how BlackRock voted to be newsworthy and follow their lead based on their size and expertise.


Yeah, and that's likely why it's on HN. Or maybe someone has an agenda ;)


Always be suspicious when politicians pass legislation that doesn't take effect until after they leave office.


Perhaps they should use this to rebuild the UI for Azure. It might be better.


The other absurdity is the nerve of these western "human rights" organizations to believe that they should dictate morality and law for the entire world.

China's censorship is no different than censorship of hate speech in the west. They have just as much right as us to decide what acceptable speech is for their country and they have just as much right as us to demand that businesses operating in their country follow the law.


This is a blog post based on a slide from the American Enterprise Institute with no supporting documentation - not exactly a highly credible source.


It was required to comply with US laws against exporting strong cryptography. In order to have a global standard the protocol had to be decoupled from the crypto implementation and clients had to be able to negotiate down to the (broken) crypto approved for export.

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


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

Search: