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

This is so true, I have seen it happen with so many projects. It always starts with a cute declarative DSL, and inevitably imperative / flow control structures emerge, at which point you wonder why they didn't use a real programming language in the first place and save you the hassle or learning a half baked imperative DSL.

- Puppet

- CMake

- Terraform

- ...

All these started with pure declarative DSL then incrementally created a nightmarish imperative monstrosity.


One reason I still love Ruby so much. It gives ability to easily define a DSL within a larger robust fully fledged language, and you can always tap on the larger ecosystem if needs evolve. This is a sharp contrast with starting something small from scratch (which might seems fine at the start), and later be on your own to scale things up as needs grow.

- Visual Studio project files are XML files that are interpreted line by line, and can contain variables, branches, and loops. Hell on earth.

They are badly copied Ant build files.

Ant came first, then when Microsoft redid the VS project format, they created MSBuild.

As incredible as it may sound, Ant is still easier to deal with than MSBuild.


Ant did not include IF THEN ELSE, unless you added the contrib package.

If you understood the paradigm, you could write branches in Ant files simply using properties and guards on properties ("unless"). Using IF in Ant was basically admission of not having understood Ant.

This said, I used Ant for a very limited amount of time.


It sure did, you use conditions, no need for contrib.

https://ant.apache.org/manual/Tasks/condition.html

The else part is easily done by repeating and negating the condition.

Two other advantages of Ant that MSBuild lacks in a sane way to this day, are macros, and proper documentation.


As of Ant 1.9.1, you can use 'if' and 'unless' attributes on any task or element in a target. I stopped using Ant a long time ago, but this was a pleasant discovery when I had to pick up an old Ant based project recently.

https://ant.apache.org/manual/ifunless.html


I agree, that is what I meant: there were people who installed Contrib to have <if> element, but in reality you did not need that you could just use Ant's built-in features like you said. In my opinion installing Contrib to use <if> was a demonstration of not having understood how Ant works.

Nice, I was basing my answer on what was there initially.

I always liked Ant, as I don't suffer from XML allergy.


The legacy version of MSBuild was really bad, but the modern MSBuild project files for .NET are actually quite concise and clean by default?

Only if you are happy with defaults and don't require any build logic.

Also you forgot MSBuild is used for everything, not only .NET.


For new .NET SDK style projects you hardly ever need to customize the defaults and I know it's used for more stuff than .NET, but I just wanted to give an example where it actually doesn't suck. Also, you may not need to do everything in MSBuild, for some more complex stuff, you can use something like Cake (https://cakebuild.net/) in .NET for example and skip the programming in XML.

.NET made into my toolbox before it was announced to the world, thanks to be working at a MSFT partner that was selected to be part of the Portuguese launch event for .NET with ready made products.

Never seen any big corp using alternative .NET build tools, rather wrestling MSBuild, or before it came to be, nmake.


Horrible. Would’ve been much nicer if they’d reached for Scheme.

You say that, but people in OCaml keep bemoaning the use of mostly declarative s-expressions in the Dune build system. Imagine the reaction if MSBuild used an actual Scheme.

Why doesn't the OCaml build system use OCaml?

You don’t want a language with non-determinism, arbitrary IO, impure functions etc. for build configuration ideally.

I guess the answer to your question is OCaml has unmanaged side effects.


They don’t know how good they really have it :)

what's even worse that schema uses extremely generic types with attributes denoting actual type.

Makes reading it even harder, and any possible constraints due to type safety go out of the window, so we get worst of both worlds.


Wesnoth the game also has that via WML. Looks very ugly and obfuscated.

CMake was never declarative AFAIK?

CMake today is effectively an eso-lang / Turing tarpit with some “modern” declarative conventions that people try to push.


"Modern CMake" is more about scoping all properties to the targets that they belong to (including stuff like what you also need to link against if you link against target foo) than about language features. The CMake language hasn't changed much except correcting some early weirdness about "if" and the addition of generator expressions, which are fortunately not often needed.

People love to hate on Maven's XML but at least it's been mostly the same since 2006. There are conditionals in profile activation expressions but they are very limited by design. Declarative done right, IMO

What's the old adage? Software expands until it can send email?

> All these started with pure declarative DSL then incrementally created a nightmarish imperative monstrosity.

"Huh?" I asked myself when you mentioned that Terraform is now imperative somehow. Took a look at the website again, and seems to still be HCL, and still be declarative. Am I missing something? How exactly is Terraform today a "imperative monstrosity"?


Terraform has modules which are an elaborate method of doing function calls. HCL 2 has loops and conditionals. It is most definitely imperative.

This is not necessarily a problem except that they had to live in the original HCL v1 landscape which makes them awkward syntactically.


> Terraform has modules which are an elaborate method of doing function calls

... What? How is modules a function call? It's just a hierarchy, everything about/with modules is still declarative.

> HCL 2 has loops and conditionals. It is most definitely imperative.

So what? Just because there is loops and conditionals doesn't mean it's suddenly imperative.

How exactly you do loops in HCL? Last time I used it, you still used declarative configuration for that, and use `for_each` as an declared option, you don't "call for_each which returns config", all that happens inside of HCL/TF, because it is declarative.

Did something change like yesterday or are people even here on HN so ignorant about what declarative vs imperative actually means?


You "call" a module with arguments. You can call them multiple times. In every way that matters they are just like a function call.

I don't understand why there is a distinction between for each in a standard language vs for_each in HCL2. They are both do something by iterating over something else at runtime. The syntax isn't what matters here.

I think maybe you are mistaken in your own distinction between declarative and imperative.


Imperative: Tell the computer how to do something, by instructing it what to do.

Declarative: Tell the computer what you want the result to be like, and the computer figures out how to do it.

for_each in Terraform is very much declarative, just like modules. Compare how you'd do the same thing with JS or any other (imperative) language you know, and I think it must be clear what the difference between the two is.


Those boundaries are pretty fuzzy. The complexity of the logic with conditionals and loops in a module means that you have pretty much stopped describing what it should like and instead described how to make it look the way you want it.

I have read terraform modules where I had to execute the logic to know what got produced which moves it from your imperative description to the declarative description as far as I'm concerned.


I think cmake kind of needs conditional checks though.

I know nothing of this world of comics, I guess because it is essentially part of the US culture and did not penetrate much of Europe.

There has been a number of investigative shows arguing the valuation of collectibles in general (comics included) is largely driven by money laundering.

Is it some kind of conspiracy theory of is this legit ?


As usual, generalising all of Europe based on your individual country is a mistake as there are some Euro counties where comics are quite popular. France, Belgium, Italy and the UK all have thriving native comic book industries, and I have Swedish friends who tell me Donald Duck comics are very popular there.

I imagine a pristine 1st edition Tintin or Asterix would be quite valuable.


I wouldn't say comics are really popular in France. But we may have different interpretations of what comics are, as I don't consider "bandes dessinées" (e.g. Tintin) as comics.


As an avid reader of BDs, I would agree with you, but for the purpose of this discussion, and for the general public, these two are indistinguishable. Even to the actual translation, which is (pardon my rusty French) somewhere in the ballpark of "cartoon strips".


I remember as a kid that Superman #1 was going for thousands of dollars and we just oohed and aahed.


For this, it is pretty legit since it is old. What is thought to be driven by money laundering is people paying crazy amounts of money for graded VHS movies or NES games.


You do need some kind of reliable, distributed storage though. The sequential nature of a blockchain also ensures that such stored content is held no matter what by any full node.


No, just no.

A simple four-hash like BSD or Gentoo Linux do with their repository is more than sufficient.

No need to record who is requesting the recording, much leas fetchibg.


The hash to verify content is only half of the problem. You also need to store the _actual_ content of the page. What's the point of having Wikipedia reference a URL + hash if the page does not exist anymore?

A blockchain is, at its core, a distributed database, it is exactly made for this use case.


You should experiment with embedded hash within HTML pages and discover their limitations.

These same limitations amplifies when going to outer scopes like URL itself, blockchain isn't immune to this.

Blockchain also has the same problem when attempting to track/verify each single vote.

W3C Subresource Integrity Recommendation

Source: https://www.w3.org/TR/sri-2/


A quick check indicates that storing something on the Bitcoin blockchain costs about a dollar. How many millions (billions?) would Wikipedia need to spend to stash everything they reference in the blockchain?

> What's the point of having Wikipedia reference a URL + hash if the page does not exist anymore?

It would be way cheaper for Wikipedia to run a durable archive service themselves than to use the blockchain as an archive.


> A quick check indicates that storing something on the Bitcoin blockchain costs about a dollar

That's nonsensical, the price of using a service on a blockchain is essentially a floating value. That is the whole point of having a token in the first place: people willing to store and people storing are participating in the price of the service.

Last I checked, filecoin was a few cents per GB per month.

You can create a blockchain of kind hearted people to store Wikipedia as well, it's really up to you. But comparing apples and oranges makes no sense.


> That's nonsensical, the price of using a service on a blockchain is essentially a floating value.

This is kind of a ridiculous response. The price of oil is also a floating value and yet it is not nonsensical to discuss the price of a barrel of oil.

Yes, the cost to store something on the bitcoin blockchain floats. Several sources indicate that roughly a dollar is a reasonable approximation currently. If you disagree I’d be interested in seeing your data.

> Last I checked, filecoin was a few cents per GB per month.

I don’t know a ton about filecoin but it seems like retrieving data is pretty cumbersome. It’s not clear that this would actually be useable for a Wikipedia reference archive.

> You can create a blockchain of kind hearted people to store Wikipedia as well, it's really up to you. But comparing apples and oranges makes no sense.

Blockchain for its own sake. Sure, you could create a custom blockchain. You could also just pay AWS for georeplicated blob storage and it would be way less complex.


It's a hash.


You both need to generate the hash at the point of archival correctly and store it in a way that cannot be modified later on.

Doing that with a blockchain like tech is one of the few use cases where the tech itself actually adds value.

Heck you might be able to store the entire pages on a blockchain or a blockchain linked storage.

The problem with these sites is that we implicitly trust them and unlike a book or other handprint media where editing or destroying all unedited existing copies is effectively impossible if a shady actor can easily start editing archived news articles and other sites that are no longer publicly available.


This is getting to blockchain for the sake of blockchain.

If Wikipedia recorded the hash of every referenced page you could verify that the archive.is page is unchanged.

You could certainly argue that archive.is isn’t the right place to store archives (I have no idea) but attempting to move all this to the blockchain would be very expensive.


You only need the hash of the original content. No blockchain is necessary. The problem is that there is no source for that hash except for the scraper that archives it since people don't put the hash in a hyperlink.

If you download an ISO for a Linux OS for example, they give you the hash of the file so you can check it. They don't build an entire blockchain whatever to validate the hash.


> Preventing data being attached to an error forces more clear and precise errors.

Okay maybe theorically, but in the real world I would like to have the filename on a "file not found", an address on a "connection timeout", a retry count on a "too many failures", etc.


But also in the real world I may not be interested in any error information for the library I’m using. I’d like to be able to pass a null for the error information structure and have the compile optimize away everything related to tracking and storing error information.

I’d like my parser library to be able to give me the exact file, line and column number an error occurred. But I’d also like to use the library in a “just give me an error if something failed, I don’t really care why” mode.


Not sure I get the reference here. Share buybacks are essentially a trick to avoid dividend tax, how is that related?


Last decade, some companies (that had more money that they knew what to do with) used that money to buy shares back. This decade, this company (that has more money that they know what to do with) invests in either "AI" or "AI datacenter" companies — and these use that money to buy the company products.


A company buying back shares is spending money to purchase an asset on the open market.

A company involved in round tripping passes fictional money in a circle and every company that touches it claims both revenue and expenses simply for passing it along.


A dividend is taxed. Share buybacks decrease the supply of outstanding shares so the hope is that the share price will increase. If shares are not sold, then there is an increase in value without incurring taxes.


> Not sure I get the reference here. Share buybacks are essentially a trick to avoid dividend tax, how is that related?

What does this mean? What's the trick?


> What does this mean? What's the trick?

The trick is essentially to buyback your own shares and destroy them. That effectively redistributes the value you bought to other shareholders, much like a dividend would.

How is that better you may ask? two reasons:

- Most investors prefer to accumulate rather than receiving cash. If you post dividends, they are immediately subject to withholding tax, so you get taxed before reinvesting.

- In a lot of cases, capital gains tax and withholding tax are different, the former being much lower than the latter. This is especially the case for funds with foreign UBOs, which incur 2x15% WH tax at the source.

- Buybacks are just more flexible, those that want cash can sell, those who prefer to accumulate are happy to stay, there's no real downside.


You can only realize the tax if the stock owners sell the stock (vs. giving them a dividend which triggers the tax on payment). It is more of a tax delay but since many people who bought these stocks have more money than they need, they no longer need to sell and they don't need the dividends much. So a buyback is just injecting that money back into their shares tax-free.


Yes, that's sort of what I thought must be happening. There's no "trick" involved. It's like saying salaries are a "trick" to avoid dividend tax. They'll still pay tax on it when they sell it.


> There's no "trick" involved

Well we can argue on the meaning of trick I guess.

Share buybacks are essentially a way to achieve the same effect as dividends, but in a non-obvious way, which has the benefit of avoiding taxation. That's a "trick" in my book, but I guess terminology doesn't matter that much.

> They'll still pay tax on it when they sell it.

Not but it's not _equivalent_. The tax paid on capital gains is not the same as the withholding tax. And paying tax _after_ compounding is not the same as paying it _before_.

Share buybacks are _effectively_ a trick to circumvent withholding tax for investors not willing to divest.


> which has the benefit of avoiding taxation. That's a "trick" in my book

But why? Minimising tax legally is...legal, and not a trick. That's all tax avoidance is.

> The tax paid on capital gains is not the same as the withholding tax.

That seems totally fine - if the rules are different then that's up to the people who write the rules. It's not a trick to choose to be paid via one method or another.


> But why? Minimising tax legally is...legal, and not a trick. That's all tax avoidance is.

I think we are lost in translation here. I am not a native English speaker, so there may be a subtle implication in "trick" that you see and I don't.

I meant "trick" as in "trick of the trade", a clever/crafty way of achieving something that may not be obvious for less experienced individuals.

Re-phrasing my original comment for clarity: "Share buybacks are just a technique to lower WH tax, why do you see this as anything related to round tripping as related in this article?".


My experience with dynamically rendered math has been the opposite: if you have lots of equations to render, it inevitably takes some milliseconds to render, which makes the whole content move around and shake as rendering takes places.


Indeed. It was hell to navigate pages that rendered MathJax on demand. That also improved a lot though.


> it inevitably takes some milliseconds to render, which makes the whole content move around and shake as rendering takes places.

What a boldly incorrect comment! It's like you didn't even read the first point in TFA!


Did you read the article? That's what the KaTeX project specifically claims to address.


The previous comment was about using KaTeX for pre-rendered equations.


It's not too late to delete this comment.


So essentially he gives 2 arguments:

1) You get intermediate results visible in the debugger / accessible for logs, which I think is a benefit in any language.

2) You get an increased safety in case you move around some code. I do think that it applies to any language, maybe slightly more so in C due to its procedural nature.

See, the following pattern is rather common in C (not so much in C++):

- You allocate a structure S

- If S is used as input, you prefill it with some values. If it's used as output, you can keep it uninitialized or zfill.

- You call function f providing a pointer to that struct.

Lots of C APIs work that way: sockets addresses, time structures, filesystem entries, or even just stack allocated fixed size strings are common.


> I act as their investment agent, assigning realistic interest rates

Author then proceeds to put 15% annual interest rate...


Where can I get 15% annualized returns, please?

(I'm told to no longer bet on even averaging 7% annually, over decades, on US stock indexes.)


15% yield would be a hell of an arbitrage opportunity if you could get a sensible loan to go along with that.


Commenter just discovered that there are other countries and economic realities outside the US/Europe


11% is a safe interest rate on my country (py), I just got a 14.5% offer for local bonds BBB+


stay vigilant Lebanon was granting 12% rates and everything was fine and “covered” by central bank until it wasnt


py = Paraguay, for those like me who didn't know


> 11% is a safe interest rate on my country

11% may be the safest bond you have access to, but that doesn't make it _safe_ in absolute terms.


up to 30k, cover 100% by the central bank


So, bonds basically all tend to converge on the same risk adjusted yield. If you're seeing yields that look like this, the market believes the currency will slip or there's repayment risk (relative to USD bonds that are in the 4.75% range.)

Imagine you have a scenario where inflation is 0 in currency A and 10% in currency B. Would you rather have a 2% bond in currency A or a 9% bond in currency B? This is why Euro bonds go negative sometimes, when USD interest rates were very low and the Euro was deflationary relative to the dollar, it could push rates even further lower.


Look, you do you, but rest assured that you don't get 11% for no reason.


I wrote an article (it's in Spanish) in which I took data from the central bank since 1990 and created a tool to simulate various scenarios. The tool includes a column showing the average interest rates on central bank-backed investments. Maybe you might find it interesting. https://roberdam.com/jubilar.html


the issue is your local currency will lose its value over time


Is there a (government-issued) currency that doesn't?


It's not an inherent feature, but they steer it in such a way so, no, there isn't (at least not for long), unless someone would make a good case for it at some point in the future

The interesting question would be what their currency, where this 11% is offered, typically loses year-on-year


> I can't figure out why this would helpful to have as a video in the first place over the text summary you posted here

For the creator: videos can be monetized trivially

For the search: YouTube results are often highlighted top of the page on Google search results.


Seriously at this point who cares about US licenses ?

It has been abuduntly clear that AI companies can train however they want, and nobody will enforce anything.

Realistically speaking, even if you could prove someone misused your software as per this license, I don't expect anything to happen. Sad but true.

At this point, I don't care about licensing my code anymore, I just want the option to block it from being accessed from the US, and force its access through a country where proper litigation is possible.


"AI companies can train however they want"

The copyright lobby wrote the EU's AI Act, which force them to publishing the list of the copyrighted works used as training data. This is an ebntrypoint to then ask them some money.


And prevents some blind people from reading it.


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

Search: