Live data from Hacker News

Giving Ada a Chance

ajxs.me

161–170 of 261 posts

Re: Giving Ada a Chance

#161

Earlier quoted context omitted.

I feel that Python will be known in the future as the language that caused a generation to have a crippled sense of reasoning about how to design computer programs. It's lack of a normal, standard scoping model alone teaches a very flawed reasoning about computer programs.

I'd vote for Javascript over Python.

Javascript is not so often used as a teaching language.

There are many languages which hammer worse practices than either such as POSIX shell scripts, but they are seldom used as a teaching language.

Python is in the unique space of having made horrible design decisions but somehow often used as a teaching language.

One would assume that programmers are to understand such concepts as block scoping rules and the difference between lexical and dynamic variables. — how is Python to teach them that?

Re: Giving Ada a Chance

#162

I took my first university course in Ada in 1981. I also worked for a company that provided an Ada runtime in the mid 80's. Ada was sabotaged early on because it was 'mandated' by the DOD for new programs. That meant that all the usual suspects, like Lockheed, GD , TI (I don't remember exactly which ones) came up with Ada compilers and runtimes that cost on the order of $10K per seat. The typical military contractor…

Amazing, since the first ADA compiler wasnt released until 1983. You'll make those HR people happy who want candidates with 10 years of experience in 2 year old languages.

Re: Giving Ada a Chance

#163

Earlier quoted context omitted.

> after my year they switched to either using Java or Python They do this because of intense negative feedback from students who don't like having to learn languages for which there is no job market.

There's something wrong with the idea that you go to college for a computer science degree just for the job market, and not the science. If getting a job is all that matters, surely a trade school or boot camp is the better route. But then I'm of the opinion that college shouldn't be in the market of mass producing future workers.

The problem is employers require computer science degrees, especially for entry level jobs. Then there's things like coding tests about inverting binary tries and such that tends to be less thoroughly covered in trade schools. When employers have more realistic demands we might see some change.

At the same time colleges are morphing into expensive trade schools, their advertising is full of phrases like "preparing you for the real world".

Re: Giving Ada a Chance

#164
post #145

Earlier quoted context omitted.

All caps haven't been a part of the language since Ada83, go check the follow up spec, Ada95. Maybe you're thinking of Niklaus Wirth's languages, the Modula's and Oberon?

Wirthian languages seemed to keep the 6bit symbol encoding of the original Pascal, where the symbols and keywords ended up case-nonpreserving. Was that changed at any point with Modula or Oberon? I never have seen any code with all caps.

Oberon is case-sensitive and all keywords are all caps. I was curious to see it because I like Object Pascal/Delphi, that was the most distracting part of the language coming from Delphi standards.

Re: Giving Ada a Chance

#165

Earlier quoted context omitted.

I help beginner python students. Python might be a nice easy scripting language for bashing out NUMPY scripts, but I'm beginning to suspect it is terrible for teaching. The "what type is this variable, and will this function automatically convert it for me" game is not very fun at all for beginners.

I feel that Python will be known in the future as the language that caused a generation to have a crippled sense of reasoning about how to design computer programs. It's lack of a normal, standard scoping model alone teaches a very flawed reasoning about computer programs.

It's lack of a normal, standard scoping model alone teaches a very flawed reasoning about computer programs.

Scoping in class definitions is weird, yes. But is that your complaint? What's wrong with the scoping model in general?

Re: Giving Ada a Chance

#166

I really like Ada's ranged types (VHDL has them also - it inherited them from Ada). You can say: type OperatingTemp is range 33 .. 90; And then declare variables of that type and they will be range checked - an exception will be thrown if the variable goes out of that range. Wish more languages had this feature.

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

That idea was neatly generalized 30 years ago. So expect it to start showing up as the hot new thing in another 20.

Re: Giving Ada a Chance

#167

Earlier quoted context omitted.

I much prefer VHDL to Verilog. Mostly because you can define your own types in VHDL but can't in standard verilog (SystemVerilog is closer to VHDL in capability). Also because the whole reg thing in Verilog just doesn't seem very ergonomic to me - I have to stop and look things up when coding state machines or similar stateful things in Verilog. In VHDL you've got signals and variables. Signals can have state. Variab…

I’ve been told Verilog is more predominant in the US and VHDL in the EU. Any idea how that happened?

Yeah, it's very weird that a language developed by the DoD ended up popular in the EU but much less so in the US. I'm not sure why that happened. I did do a stint in Italy about 16 years ago and they preferred VHDL there at that time as well, so it's not exactly a new phenomenon. I did a VHDL project for a US company last year so it's not like it's completely unheard of here. Another way to look at it is that there are fewer people who know VHDL so when you do find places that are doing VHDL projects there's less competition.

Re: Giving Ada a Chance

#168
> It is possible to define a struct type in C with bit-fields for the individual elements, however the C standard does not guarantee the layout and order of the individual fields.

As a professional embedded developer who uses bitfields to access registers every day, this doesn't really make a practical difference. On any bare-metal or embedded project you will rely on the behaviour of your compiler, and portability is largely irrelevant if you're accessing memory-mapped registers. Probably, the manufacturer has already provided register maps using bitfields anyway.

Re: Giving Ada a Chance

#169

I really like Ada's ranged types (VHDL has them also - it inherited them from Ada). You can say: type OperatingTemp is range 33 .. 90; And then declare variables of that type and they will be range checked - an exception will be thrown if the variable goes out of that range. Wish more languages had this feature.

It's not obvious from the syntax but Nim takes a fair amount of inspiration from Ada including this.

Re: Giving Ada a Chance

#170
post #154

Earlier quoted context omitted.

I think it’s time we start expecting 100% memory safety as table stakes, because any flaws are catastrophic. Moore’s Law has more than paid for it; Android could run an animated display and a Bluetooth stack in a wristwatch seven years ago.

One area where I think Ada has the edge is providing language constructs that make bare metal programming safer. Concepts like 'dangling pointers' and 'memory leaks' aren't relevant in a programming environment without a heap. In bare-metal programming on a microcontroller you're more likely working within a flat memory model where the 'memory safety' provided by some modern programming languages is less relevant. Ar…

You can absolutely cause a pointer to dangle without heap allocation. Pointers can point to the stack too. You also have stuff like iterator invalidation, which is sort of a special case of a dangling pointer.
Post reply on HN