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

The current government is just so bad?

Come on, just look at SELIC during the second FHC government... the interest rates went sky high, the Real had a monstrous devaluation overnight (from R$ 1.32 to U$1 to R$2.16 to U$ 1).

FHC sure helped to stabilize inflation rate, but he almost destroyed brazilian economy. His second government was nothing short of a disaster.

SELIC history: https://www.bcb.gov.br/?COPOMJUROS


FHC govt is interesting. It was the govt that mostly opened up to USA control. He borrowed a lot from the international funds, and made every effort to never pay more than the interest.

Also sold all state owned companies, which mostly dealt with infrastructure, creating huge foreign owned monopolies. For a while, mobile and internet was worse than it is in the USA now, but the last two governments made improvements there (for example, now for US$0.30 a day --US$9/mo!-- you have a prepaid phone with unlimited calls, text and data ...well data was pulled out of that law last months. it is now 200mb instead of unlimited)

But it was also one that most spent in advertisement. So the public loved it. And even attributes the Real to that president.

The last goverment managed to pay out all the international funds FHC borrowed from.


I am from Brazil, and although I don't like FHC party either, I remember even during the crisis of his second government, I didn't hear people blaming him all the time, I think because at the time it was understood because it had to do with the Asian crisis (the 1998 crisis affected Brazil badly), and because people still remembered how bad it was before him.

Now replying your specific question: "The current government is just so bad?"

Yes.

Many of our numbers are the worst in 20+ years, without a solid external economy justification, our troubles are not because lack of exports or other serious effects caused by other countries that were unavoidable, but purely incompetence (or malice...)

Brazil consumers have the lowest confidence in 22 years, our GDP will have the biggest decrease in 24 years, inflation is the highest since FHC fixed it 20 years ago, the income of people, even if you ignore the exchange rate and count only in absolute BRL numbers, is decreasing, and although unemployment is "low" according to the government, the actual number of employed people is low too*

Also the president batantly lied at her campaign (she said she would not do lots of things she immediately did as soon she was re-"elected"), and lied about the energy situation.

The energy situation lie: Because the lack of rains in Brazil (that seemly is linked to the lack of rains in California), we can't rely on Hidroelectric powerplants, but the distribution lines are not all done, meaning that brownouts in some areas are likely (and we even had a country-wide blackout this year, when in the hottest day for some time, the extra power draw from air conditioners made the power lines overload), the president made several discourses with lies about this, trying to hide the situation for her upcoming campaign, she ended forcing the government as whole to give lots of conflicting information about the power situation, as result lots of important business that rely on great amounts of electricity (for example several types of metallurgy, manufacturing, cement industry) to stop investments, this started to cause unemployment and other issues long before Petrobras problems came to light.

Who in their right mind would invest in a country where you can't find reliable information about the infrastructure situation?

And of course, we have Petrobras issues by itself (for example for some problems caused while the president was working for Petrobras and even signed documents that caused the issues, she just stated she didn't read the documents... so she is grossly incoptent, or a malicious liar)

Of course, I might be biased, since my family has a personal bone to pick with the president (the president approved some stunts in 2013 and 2014 that led to several companies that work for the government get defaulted, my family in turn sold stuff for those companies, that defaulted us, saying they would pay us when the government paid them...)

* Brazil copied US bullshit unemployment number: you are only "unemployed" if you have zero income, government handouts included, and is looking for work, if you gave up, or get money from the government, or has income, even if it is tiny and from an illegal source, you are not unemployed


Good points. I just don't agree with the rethoric that this is the worst Brazil ever had. Specially ignoring that in the nineties no corruption scandal was ever investigated... there are numerous cases... sadly all hidden under the carpet.

I hope that someday people will judge their representatives not based on their sympathy for a given party, but on actual meritocracy.

I don't think the actual government is the best, I just think it is the least worst we could get at the present time.


So we agree to disagree. The PT (workers party) government changed Brazil forever by:

- creating thousands of politically-appointed public servant jobs and other money-sinks. - corroding the power of one of the best legacies from the former Cardozo president: Lei de Responsabilidade Fiscal (fical responsability act), that was meant to prevent the executive from overspending.

Their ideas are close to the "Chavismo" that destroyed Venezuela, and they are doing a pretty good job trashing Brazil.


You do realize lack of water and power is a problem of the State government (governor) and not federal government (president), right?

Edit: which for sao paulo, where i guess you are from, it all started with PSDB, same party as FHC. Also same governor that started to use military police on pacific protests.


This is just an attempt at blame-shifting.

Energy: it was the Federal policy of subsidizing energy and the price caps that led to the energy crisis. The (few) private companies had little incentive to invest in improving capacity of the grid, the state-owned ones were a mere instrument to keep the cronyism going. The government has been chanting about Petrobras and pré-sal for at least 10 years now, even though they know that it is yet to be determined if it will be net-positive in terms of revenue. If at least it was a calculated risk but Petrobras was well-managed, then so be it. But it isn't, and Petrobras corruption scandal is directly linked to Dilma.

Had the Federal government a sound plan for reducing the dependency on hydro-electric power, or at least allowing the construction of new plants, the brownouts wouldn't have happened, even if the "drought" was real. Hadn't the Federal Government managed to completely dilapidate Petrobras for pure political benefit, it could've been given the benefit of the doubt. But it didn't, and it should be pointed as responsible for the current crisis.

Regarding water: I'd buy the argument that it was a state-level issue if it was only seen in one or two states, but it is ongoing in the whole Southeast and Midwest of the country. And while levels of waste in Brazil are bad, the cheap cost of water to farming and deforestation are much worse.

This "is a state-level problem" is just an excuse from PT to take a jab at São Paulo's governor. They never point out the problems existing in PT-governed states. Another thing is that those pro-PT argue that the problem in São Paulo is due to Sabesp being a private company. This is just a lame excuse to support the notion that it should be state owned. The problem is not being private or public, the problem is that it is a monopoly.

If ANA (a federal agency, by the way) was serious about solving the issue, they could enact a bunch of norms to force better control of the resources and break all monopolistic companies into smaller ones and force competition. But because "privatization" and "free market" are verboten words in this government narrative, it will never happen.

---

Just an aside: this whole thread has already derailed completely from the original link and it has become a point for the Brazilians to discuss politics and each to show their allegiances. I'm all for a good, rational discussion, but I'm yet to see this irt politics, especially in Brazil. Instead of arguing on the ideas, people make "their" political party as part of their identity and simply refuse to have constructive dialogue. It is worse than football. How about we keep this off Hacker News?


>> Just an aside: this whole thread has already derailed completely from the original link and it has become a point for the Brazilians to discuss politics and each to show their allegiances. I'm all for a good, rational discussion, but I'm yet to see this irt politics, especially in Brazil. Instead of arguing on the ideas, people make "their" political party as part of their identity and simply refuse to have constructive dialogue. It is worse than football. How about we keep this off Hacker News?

This is what I meant when I said that I wish for the day when people will not make judgements based solely on their political affinity.

Sadly, it is almost impossible to talk about politics when people start to see you as an enemy just because you disagree with them. It is even worse when you see, as it happened in Brazil, people with good education going to the streets asking for a military coup... that is crazy. A democracy is better than a dictatorship, even a corrupt democracy, at least you can change the president after a couple of years.


Looks like we are not getting out of this discussion, so here we go...

This "people with good education asking for a military coup" is blown out of proportion by supporters of PT. Perhaps a few crazies do indeed think that, but most of the ones during the protests were talking about "intervention", due to considered abuse of the institutions by this corrupt government. And even that can be done in a totally legal and according to a due democratic process.

However, what the supporters of PT keep repeating is that "the opposition wants a coup", you included. So you are doing no better than "the other side of the trenches". If you really want to engage in the discussion, you should be prepared to argue with the "best" part of the opposition, instead of just trying to invalidate the whole other side based on a few exceptions.


> It is even worse when you see, as it happened in Brazil, people with good education going to the streets asking for a military coup... that is crazy

That's such a silly thing to point out. In every single anti-government protest that happened so far, pro-military groups were the tiniest minority. Look up Datafolha's research about the Paulista protests - even though that research has several problems, it makes it pretty clear that almost everybody there opposed a coup (or "intervention").


I never said that most people ask for a coup. I said that seeing people doing this is crazy. You read what you wanted to read, not what I said.


aren't they building several new hydro plants across the crountry, even the controversial itaipu (which i completely disagree with)?

and you are completely paradoxal... try to read your comments before posting :) should the water company be state owned or private? you keep changing your mind every paragraph


Itaipu? Being built? Perhaps you mean Belo Monte?

1) That hardly counts as "several".

2) It is not ready yet. The current project is being discussed since 2002. Estimated date to open is ~2019. Which is yet-another sign that they are simply ineffective, incompetent, or both. Even if they are aware that a plant will take 15+ years to be built, they'd have to come up with a plan to support the grid in the mean time.[1]

3) So you want to play armchair energy expert: without building something like Belo Monte, how would you secure Brazil's energy needs? What do you think is a viable plan that allows the production capacity to increase, keep costs low and fair? [2] Please don't say "Solar" or "Wind" if you don't have any actual cost analysis and a feasible strategy.

---

Regarding public vs private: I really should recommend you reading again, and showing me any passage where I defend one or the other. In what I wrote previously, I haven't said anything of some sort, rather I just pointed out the flaws in the argument used by the "SABESP-is-bad-because-it-is-private" and the "none-of-this-would-happen-if-it-was-a-public-company" crowds. What I said is the situation of monopoly is bad. Which part you don't understand?

Also, do you see how this conversation is already completely off-topic? Now you want to include "police violence against peaceful protests" in your laundry list of talking points. I really don't want to go down this hole, when you can't even realize that the "water crisis" is not restricted to São Paulo, and that the Federal Government is also responsible. If you really want to discuss the topic at hand, fine. If you just want to shout against your political opponents, count me out.

---

[1]: One of the most valid criticisms against São Paulo government is in how slow they are to extend public transportation. What happens is that a metrô station is planned for one demographic and by the time it is opened, it is already under-dimensioned. But at least they try to establish plans for the time of construction. The Federal government not even gets to do that.

[2]: The current mechanisms give the illusion of low prices when they get their bill, but the true costs are hidden because the subsidies are only possible through taxation. So people pay low bills, but a lot in taxes. It is perverse.


It's easy to blame the government when the people that are ultimately at fault. Brazil just reelected their president.


I don't really believe she was re-elected.

First elections in Brazil are mandatory, people tend to vote on the "least worst" candidate, or in the one they remember more from ads.

Second, elections in Brazil don't have vote re-counts, when you input a candidate in the electronic pooling stations, they just add a "+1" to some variable, or at least this is what they should do, the government don't allow third parties to examine the stations, so there is no way to know what they are really counting.

Finally, in lots of nearby countries there has been elections with similar results (members of Forum de São Paulo winning with around 51 or 52% of the votes) and the same company took care of the elections in all those countries.


The electronic devices are, from a technical point of view, flawed. That doesn't mean the votes have been tampered... though I agree that this should be fixed.

On the other side, this same electronic devices are in use since 1996, thus all elections ever since fall under the same suspicion (even the one won by FHC).

The problem is that political parties only act when they are loosing. Now, the losers claim the devices can be tampered with... of course they can. But why didn't they make these devices right when they were in power?


Your replies make me assume you like PT and dislike PSDB and assume I like PSDB...

that is not my point, and I has always been against the electronic ballots, I don't trust election results of any election since the electronic pooling stations, I am only more distrustful at these elections, because of the other things I mentioned (several friends of PT winning with 51%, the same company working on all those elections, some cities where people proved there was outright fraud, for example in one city people found memory cards and voter lists in the trash) and because of the popularity pools (before, and after the elections Dilma was unpopular, only DURING the elections her popularity suddenly rose... I don't believe people are THAT stupid)


For lack of a better option. I left Brazil, so I don't vote anymore, but had I still been there, I would probably have voted for Dilma even though I'm strongly against her party. She was the "least worse" alternative.


Aren't you required by law to vote? My wife had to pay some fines for not voting when we went to Brazil a few years ago.


Yes, voting is compulsory (required by law) in Brazil. Citizens can also cast a null/blank ballot if they feel that the candidates on the ballot should not be elected. Despite this, only 76% of citizens actually voted in the last presidential election. 69% of the population voted for one of the candidates, only 7% voted null/blank. [1]

1: https://en.wikipedia.org/wiki/Brazilian_general_election,_20...


You have the option to justify your absence if you can prove that you weren't close to a place where you can vote. That is my case.


I live in the US and there's no close (as in commute distance) consulate to where I live. I have the option to justify my absence from voting.

Edit: it's actually pretty neat BTW. My state offers and online system and I can get done with the justification in less than 5 minutes.


as i said in another comment, FHC is the one that most spent in advertisement.

Yes, GDP is bad now, but employment is at an all time high. while it was at an all time low during FHC.

employment rates is something odd. while GDP everyone fells somewhat equally, employment is only felt by that group of people. So you have to try hard to not alienate yourself on those matters.


> advertisement works

...as you all can see proof by this comment being downvoted without any comment against :)


Yes, the SELIC exploded and the Real was devalued overnight as soon as people realized that the party currently in power had chances to win an election.

Disaster is what we are living through now. Can you get any example of hight inflation happening at the same time as hight interest rates on Brazil since the Real Plan? Or, can you get any other example of hight inflation at the same time as a decreasing GDP? Or can you get any failed coup from FHC times?

FHC surely didn't do everything right. I have plenty of complaints. But to even compare his government to any of PT's is absurd.


Get your facts right. The devaluation happened in 1999, a time when thinking that Lula would win an election was actually a joke.

If you go to BACEN you can look for yourself to get the historic data on inflation and SELIC interest rates. FHC was able to both have high interest rates, high inflation rate and a broken economy (or did you forget that brazil had to ask IMF for a huge money lend?)...

I don't know what you mean by a coupe... but it is well known that FHC paid congress men to pass the law allowing him to be re-elected. Curiosly, now they think re-election is bad... go figure.


alberich, these kids debating politics today don't like to take leverage of internet to understand what really happened in their country. And then they come here to HN to say bad things about Brazil looking for "liberals" support. Silly boys.


It's depressing enough to see it on Facebook. Here it's unbearable. HN should be preserved as a place people discuss using facts.


Petista detected.


So, this is your best argument?

Very reasonable.


Somebody should downvote this guy!


>> By simply changing your language to one with a modern implementation, you can save considerable money on hardware.

Well, maybe thay can save even more money on developers by not switching languages. After all, if raw performance was all that matters people would probably still be programming in assembly.


well, you're supposed to validate user input before passing it to the function.

I'm not sure this can be considered a bug.


Here in Brazil (at least in some cities) we have the worst of both worlds... you pay for it, and there is not enough space... it is a complete crap. No wonder so many people are on the streets manifesting against it.


Here in the Faroes (at least in the capital), we have the best of both worlds. Free, and plenty of space.

In 2007, the fare for municipal busses was removes, and at the same time, more frequent trips were introduced (by 50% at day time).

The routes and schedule are managed by the City Council, the operated by the lowest bidding bus company.

So far, it has been successfull, but it had a bit of a bumpy start. The sudden increase in demand for busses, meant that there weren't enough busses to go around and some cheap, old ones were used. But the success has meant that there was a business case to upgrade the busses.

It's payed by tax payers via the Council. The Council is funded via income tax, currently at around 20%.

http://www.torshavn.fo/Default.aspx?pageid=822


That's what you get when the government mandates a monopoly for a private company.

If the buses were free, and the governemnt payed per bus, not per passenger, we'd probably have empty buses here too.


Does someone knows why FreeBSD doesn't offer any virtualization platform based on Intel VT or AMD-v? Is there any architectural incompatibility or is it just a case of virtualization not being a high priority?


Virtualization is a priority, both as a host and a guest, but especially on the host side there's a fair amount of work to be done.

BHyVe is FreeBSD's own hypervisor, and can run FreeBSD and Linux guests, but is not yet available in a release.

VirtualBox works well for end-user applications on current FreeBSD releases, and is being used by kernel developers in their workflow.


For FreeBSD, I think your choices for virtualization are limited to jails or Virtualbox. Virtualbox on FreeBSD does support Intel/AMD processor virtualization extensions I believe.


Cool, I thought it could not use the extensions and thus would be slower than other options like Xen or KVM.


They're still working on BHyVe, but it'll probably be a few releases.

They do however have fairly-powerful jails(not as powerful as LXC though), and I think you can run VirtualBox... Or maybe not.


> They do however have fairly-powerful jails(not as powerful as LXC though)

To be honest, I grew up on BSD's, FreeBSD especially, and only later turned to Linux due high marked demand. In my projects, I've tried using LXC as the light (kernel) virtualization of choice, but I've found it extremely buggy, with a lot of security issues, implementation different in almost every flavor of Linux, documentation lacking... Not even close to maturity of Jails, to which I eventually turned back to. Dont get me wrong, I am still big fan of LXC and I can see it working in future, and having features I would like to see in Jails (they're getting there, especially recently) like fine grained resources control and restriction and so on, but as of today, it needs a lot of work in polishing and maturing the code.


> fairly-powerful jails(not as powerful as LXC though)

IMHO LXC wishes it were jails with vimage, and if you really wanted some hillarity you could actually run a linux container-like system under a jail using the linuxulator.


Linux namespaces allows namespacing almost any subsystem, although I don't know what FreeBSD offers w.r.t that.


> Linux namespaces allows namespacing almost any subsystem

Namespacing has nothing to do with it. Not even a decent try.


>not as powerful as LXC though I think many would completely disagree with this.


There are not a lot of options but VirtualBox works pretty excellently. There's also BHyVe and you can always use Qemu :)

The lack of hypervisor support is really more due to people not keeping up with the porting work. I would love to see Xen actively supported but I think BHyVe is going to be where the most work gets done.


This theory is fine, but isn't the Taliban the strongman in this case?


Sure, but the U.S. could not decide to install the Taliban as their preferred strongman. The proximate cause to invading in the first place was to break up the Taliban who had hosted and provided the breeding ground for Al Qaeda operations against the U.S.

Given that the idea is to stamp out terrorism against the U.S. they can hardly decide to have the terrorist-friendly strongmen back in charge.


Now that is what i would call a "success story". How many distros can claim to be used in the space? :)

I'm glad to see Debian being recognized for it's rock solid stability.


On a similar theme, the developers of matplotlib once got a polite enquiry about a bug report which mentioned that "the feature is needed for the Phoenix project, and their arrival at Mars will be in March sometime."

Needless to say, the bug got fixed. A team from JPL is listed in matplotlib's credits for various improvements.


NetBSD: https://en.wikipedia.org/wiki/NetBSD#Examples_of_use

Agreed. The Debian developers should feel proud of the accomplishment.


I'm a bit curious, why do most programmers like to call themselves engineers even though programming is not engineering?


No, you're not curious, you're just passive-aggressively pointing out that you don't think programming is engineering, but phrasing it in such a way as to make it sound like this is some universal truth that everyone accepts.

Anyway, the answer is because it is engineering. Not in the capital "E" sense of engineering where you have some sort of official certification from some governmental or professional body that states that You Are An Engineer, By Golly. But it certainly is lowercase "e" engineering in the sense that it is a highly technical discipline that lies squarely in the middle of the spectrum between an art and a science.

Plus, it's just common terminology in the field, so there you have it.


But there is an insanely huge difference.

When a credentialed engineer puts their signature to the statement that a particular design is sound, the engineer is liable. Not the company. The engineer. If that bridge collapses, the engineer can be sued. And if the company cannot find an engineer who is willing to sign, that bridge cannot be built.

This is very important. Before we instituted this system, the USA had an average of one bridge collapse per week. And it wasn't nearly as large a country as it is today.

As long as I do not have this kind of liability, and likewise lack the power to tell a company that they are not allowed to release a website with the defects that I can identify, I do not consider myself an engineer. I may be forced to accept that my job title says "engineer", but I am firmly of the opinion that I am not one, and anyone who thinks that I am is uninformed on what it means.


Programming CAN be a system of Engineering (and often is wrt medical and weapon systems). Most programming is done as a craft in businesses, with business needs that reward turn around time and coming in under budget more than ruggedness, or real maintainability.

In a more corporate environment, it tends to favor the use of "Architecture" roles, and the use of many different design patterns even when they are not necessary and only add complexity in the name of "consistency" with other "enterprise" implementations.

Just the same, most software development is a model of crafting, not engineering. The exceptions to this tend to be with designing software that works with physical devices for a given role, not generic computing devices that are virtual representations of business logic.


ABET's predecessor described engineering like this:

    The creative application of scientific principles...
Programming primarily applies logic and mathematics, which is why I have always considered programming/computer science to be more of an "applied mathematics" field, than engineering.

Christ, computer science and mathematics are the only two fields I know of that care about graph theory. To my understanding, graph theory is a post-graduate discipline in mathematics, and a computer scientist's bread-and-butter. What does that tell you?

Anyway, this all kind of hinges on whether mathematics is a science. Personally, it never seemed like a science to me- and I don't mean to denigrate mathematics. Rather, it seems completely apart.


You can learn a lot of graph theory in your early undergraduate years. Only the most difficult problems are really graduate/post-graduate fodder.


I think probably because in the real world, programming and software engineering are the same thing. You can't write a program without engineering at least some of it, even if the overall design was not yours.


Because most of them are software/computer engineers who also program as one of their skills.


Because not all cultures have strict rules about who gets to call them selves an "engineer"

And if you are a technical programmer you are doing engineering eg writing weather simulations for the met office or modeling a nuclear rector.


why the downvote? Donald Knuth himself describes programming as an Art.


Probably because it's off-topic and people are sick of hearing about it.

It's simply a discussion people aren't interested in having, and at the end of the day it's the participants who decide what gets up or downvoted.


It was when Donald Knuth wrote that, 50 years ago. Nowadays it is engineering. It is desirable for a programmer to build software, within a specific time, specific cost and certain specs. 100% Engineering. Now this is valid for 99% of software jobs out there. You will always find some company that does software research, but it's the 1%.


I do agree that software development is many parts engineering, but I believe that farming is engineering to the same extent (I do both, so I have an intimate knowledge of how they compare). Imagine a farmer calling himself an agricultural engineer.

It is part of the nomenclature now, so it is what it is, but I don't see what was wrong with the previous "programmer" or "software developer" titles. The engineering part was already implied.


Indeed, in some countries (like mine) calling yourself an engineer while not having the real degree it's illegal, even if it's your job description.

Incidentally, here (Argentina) we have the equivalent of farming engineer, called "Ingeniero Agrónomo". It's a very common career choice, and well paid.


Unless you are the Black Knight, eh? It's just a flesh wound!


And you can always bite them then.


I think i'm missing something. On slide 4 it says (the code) it has 0 exceptions and is robust, but then on slide 7 it says that (the system) it crashes without stack traces? Is that right?

What did the OP meant by being robust, when the code crashes unexpectedly?


The cynic in me says that unless Haskell has a magical "do the right thing in every situation, with automatic full knowledge of your application's business requirements" operator, if there's no specific logic in the code that responds to errors, they're just ignoring them (or else they're building a very bare bones app - any nontrivial piece of software will have potential error conditions out of its control that it has to react to in very specific ways that depend on the app itself).

In which case I could produce an equally "robust" Java program by wrapping everything in a try/catch and not logging anything. Except that in Java, or just about any other language, with a single method call I could obtain that elusive stack trace that OP is sorely missing. Which, in real applications (which, to be fair, I've never been masochistic enough to write in Haskell), I always do, and it significantly improves our ability to track down the remaining unanticipated conditions that our error handling logic hasn't already handled in well defined ways. And that sort of work should consume most of anyone's time spent developing, because the happy path is the easiest piece of the puzzle - engineers handle all code paths, hackers handle the most important ones, and hacks only handle the best case scenarios.

I'm not really getting what Haskell has helped here, apart from making the article more upvote-able.

That said, the presentation slides don't give me even a vague sense what the real thrust of the presentation was, so I'm probably missing the substance. I take issue with this being posted without any additional context, but I'll grant the benefit of the doubt and assume that there may actually have been something worth listening to if we didn't just have the slides to look at.


Haskell doesn't need a magical "do the right thing" operator. What it does instead is constantly nag you, saying, "but you haven't considered this case".

This causes you to think about you code in much more depth and generally leads to good results without the need to constantly debug.

I find that things written in Haskell that compile generally work first time more often than the law of averages would seem to allow.


Exception in Haskell is more specific than in other languages. There are many ways to have "unexpected circumstances" such as Maybe, Either, Error, Mplus, Alternative, and the transformer variants thereof. Exceptions refer explicitly to "asynchronous" exceptions—the kind in most other languages, that imply global changes in control flow that are difficult to reason about.

People tend to avoid this behavior except in rare circumstances. That said, it's easy to replicate locally with the Cont monad. These local reflows are easier to reason about as well. You can even build it atop delimited continuations for more control. These are great for covering early stopping in searches, for instance.


>Exceptions refer explicitly to "asynchronous" exceptions

This is not technically true. You can throw exceptions from pure code, either explicitly or with something like an incomplete function definition (which the compiler should warn you about). However, it is considered very bad practice to do so.


Sure, and if you treat them all as `undefined`/bottom then you get CPO semantics. Usually "Exception" still refers to `Control.Exception.SomeException` and `error` is bottom.

Catching "undefined" from pure code is the danger that leads to massively confusing semantics—it breaks down the "value" concept badly. The `spoon` library is a great example of this and it's scary to see it in places. That said, it's not terrible for wrapping up foreign code that isn't quite unsafe enough to need "IO" treatment.

The best usage of "error" is to mark completely impossible situations. These show up easily when you do dependently typed stuff with GADTs, but can also exist due to various algorithm invariants.


Well written Haskell code pushes as much of the business rules as possible into the type system. It uses the type system as a tool to keep you from forgetting to check corner cases or prevent you from creating states that make no sense in the context of business rules.

The canonical example here is using a distinct type that can only be produced by conversion functions to ensure that user input is always escaped correctly on it's way to the database or a web page. Code that fails to perform this escaping won't just send dangerous data somewhere, it will fail to compile. With care, the same can be done for ensuring business rules are also observed. In many ways the distinct-types-with-conversion-functions pattern is the tip of the iceberg here.

It's obviously possible to not do this, but that's a bit like using a database by shoving all of your data into one giant string then complaining that the database doesn't help you with anything.


Cool, this can be done in any language with typing. For languages with dynamic typing, you would just check the type at runtime.


There is a big difference between static and dynamic checking. In a statically checked language like Haskell the error is guaranteed to be caught at compile time rather than maybe being caught runtime.


One of the main things that drew me to Haskell is how little effort it takes to define a new type.


It can be, yes, but it's easier to do so in Haskell. Some of the compiler extensions allow you to push truly crazy invariants through type checking.

Also, for most dynamic languages, checking the type at runtime goes against the grain of the language. Python or Ruby code that is littered with type checks is often unnecessarily brittle.


In Haskell one typically eschews exceptions in favor of for instance the Error monad, as you don't get a typical stack trace in a lazily evaluated language.

Probably they have experienced some exception during development, but have had no exeptions in productin.


Likely that is referring to the fact that when it crashes, it crashes in a way that can be interesting to debug. I took it as a comment about development vs one about production.


"can be interesting to debug" sounds scary :-)


Lazy languages don't have equivalent call stacks as strict languages. However, GHC lets you get a stack trace via profiling. E.g. +RTS -xc flag gives a stack trace.


The actual evaluation stack (re: GHC w/ DWARF symbols) is also quite useful for debugging and doesn't need a profiled executable to work.


I think s7 was emphasizing issues getting what strict/eagerly evaluated languages refer to as stacktraces

http://hackage.haskell.org/trac/ghc/ticket/3693

http://www.haskell.org/wikiupload/6/6c/Hiw2012-simon-marlow....


[ed] oops, nevermind, see dons' post above re:"+RTS -xc", probably shd mark the trac ticket superceded or something


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

Search: