Discussion:
[OT] Ada gems
eles via Digitalmars-d
2014-10-14 13:52:22 UTC
Permalink
Just a bunch of links:

http://www.horstpeterhermann.de/ada_related/gems.html

This one reminded me D, with some hints about what could still be
offered:

http://www.adacore.com/adaanswers/gems/ada-gem-7/
bearophile via Digitalmars-d
2014-10-14 14:56:08 UTC
Permalink
Post by eles via Digitalmars-d
http://www.horstpeterhermann.de/ada_related/gems.html
This one reminded me D, with some hints about what could still
http://www.adacore.com/adaanswers/gems/ada-gem-7/
Two nice ones:

http://www.adacore.com/adaanswers/gems/ada-gem-24/
http://www.adacore.com/adaanswers/gems/gem-140-bridging-the-endianness-gap/

Bye,
bearophile
eles via Digitalmars-d
2014-10-14 14:56:52 UTC
Permalink
Post by eles via Digitalmars-d
http://www.horstpeterhermann.de/ada_related/gems.html
This one reminded me D, with some hints about what could still
http://www.adacore.com/adaanswers/gems/ada-gem-7/
Hijack, also OT: using C++ without memory management

http://engineering.adap.tv/listing/why-we-use-c-without-using-stl-or-boost/
eles via Digitalmars-d
2014-10-14 15:30:13 UTC
Permalink
http://ask-beta.slashdot.org/story/14/04/30/1344224/c-and-the-stl-12-years-later-what-do-you-think-now

"I've been using it professionally for 15 years now, and if I
observe anything, it's that the longer I use it, the more my
stuff looks like C. I keep shaking my head at younger colleagues
mis-using templates all over the place ("re-usability!", and
hour-long compile times, coupled with really non-obvious implicit
conversions and instantiations, never mind the error messages),
and object-oriented hierarchies where each object is such a tiny
part of the system that you need to remember 10 classes at the
same time just to have a slight inkling of what this thing is
actually supposed to do."
Paulo Pinto via Digitalmars-d
2014-10-14 19:49:08 UTC
Permalink
Post by eles via Digitalmars-d
http://ask-beta.slashdot.org/story/14/04/30/1344224/c-and-the-stl-12-years-later-what-do-you-think-now
"I've been using it professionally for 15 years now, and if I observe
anything, it's that the longer I use it, the more my stuff looks like C.
I keep shaking my head at younger colleagues mis-using templates all
over the place ("re-usability!", and hour-long compile times, coupled
with really non-obvious implicit conversions and instantiations, never
mind the error messages), and object-oriented hierarchies where each
object is such a tiny part of the system that you need to remember 10
classes at the same time just to have a slight inkling of what this
thing is actually supposed to do."
Actually I prefer,

"I used to love c++ and berade people who used wimp languages like Java.
These days I mainly use java, and when I do have to use c++, it feels
painfully dated.

At to C++11, while it added some useful stuff, in general it feels like
it's just flailing while trying to bring in some of the language
features of newer/more modern languages. The new concurrency stuff in
particular is just plain unseemly.

Also, a relatively minor but annoying and long-standing problem with
doing anything non-trivial in c++ is the lack of consistency between 3rd
party libraries. Java has spoiled me into expecting everything to adhere
to one convention, but with a c++ project as soon as you've got more
than a few external libraries, you end up with a huge mess of code that
doesn't mix properly, and writing adapters for everything to get that
consistency is just insane.

Long rant short: I'm finding myself using c++ now mainly for:
- small bits of functionality to be used via JNI
- small stuff mainly focused around one library/task (Qt, pqxx, whatever)

Doing anything large and complex with c++ these days just doesn't appeal
to me any more. I can build it much faster with java, it'll be more
maintainable, and performance wise it's fine for what I do."

It reflects quite clearly my work environment since 2005.

--
Paulo
via Digitalmars-d
2014-10-14 20:08:13 UTC
Permalink
Post by Paulo Pinto via Digitalmars-d
Post by eles via Digitalmars-d
http://ask-beta.slashdot.org/story/14/04/30/1344224/c-and-the-stl-12-years-later-what-do-you-think-now
"I've been using it professionally for 15 years now, and if I
observe
anything, it's that the longer I use it, the more my stuff
looks like C.
I keep shaking my head at younger colleagues mis-using
templates all
over the place ("re-usability!", and hour-long compile times,
coupled
with really non-obvious implicit conversions and
instantiations, never
mind the error messages), and object-oriented hierarchies
where each
object is such a tiny part of the system that you need to
remember 10
classes at the same time just to have a slight inkling of what this
thing is actually supposed to do."
Actually I prefer,
"I used to love c++ and berade people who used wimp languages
like Java. These days I mainly use java, and when I do have to
use c++, it feels painfully dated.
At to C++11, while it added some useful stuff, in general it
feels like it's just flailing while trying to bring in some of
the language features of newer/more modern languages. The new
concurrency stuff in particular is just plain unseemly.
Isn't concurrency/parallell stuff coming in C++17?

I found the cppcon roundtable on concurrency interesting:


Paulo Pinto via Digitalmars-d
2014-10-14 20:47:15 UTC
Permalink
Am 14.10.2014 um 22:08 schrieb "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?=
Post by via Digitalmars-d
Post by Paulo Pinto via Digitalmars-d
Post by eles via Digitalmars-d
http://ask-beta.slashdot.org/story/14/04/30/1344224/c-and-the-stl-12-years-later-what-do-you-think-now
"I've been using it professionally for 15 years now, and if I observe
anything, it's that the longer I use it, the more my stuff looks like C.
I keep shaking my head at younger colleagues mis-using templates all
over the place ("re-usability!", and hour-long compile times, coupled
with really non-obvious implicit conversions and instantiations, never
mind the error messages), and object-oriented hierarchies where each
object is such a tiny part of the system that you need to remember 10
classes at the same time just to have a slight inkling of what this
thing is actually supposed to do."
Actually I prefer,
"I used to love c++ and berade people who used wimp languages like
Java. These days I mainly use java, and when I do have to use c++, it
feels painfully dated.
At to C++11, while it added some useful stuff, in general it feels
like it's just flailing while trying to bring in some of the language
features of newer/more modern languages. The new concurrency stuff in
particular is just plain unseemly.
Isn't concurrency/parallell stuff coming in C++17?
I can use other languages *today* or wait until 2020 for C++17 to be
available across all major compilers.

This assuming that they don't repeat the errors of C++11 in that regard.
Post by via Digitalmars-d
http://youtu.be/AfI_0GzLWQ8
I did watch it, had no idea of the current problems with async.

--
Paulo
eles via Digitalmars-d
2014-10-15 07:27:37 UTC
Permalink
Post by Paulo Pinto via Digitalmars-d
Am 14.10.2014 um 22:08 schrieb "Ola Fosheim
I can use other languages *today* or wait until 2020 for C++17
to be available across all major compilers.
IIRC, the standard team said something that for C++17 will be
many technical notes that will implement changes available in
experimental, thus people should be able to include them in their
code.

Of course, having the compilers implement those, is another
matter.

In defense of C++, beyond its C roots & compatibility, it also
have been the language that made the mistakes useful for the
other languages. That is, Java and C# capitalized on C++'s
mistakes by simply not repeating them. Of course, mistakes are
obvious only after they are made and, as such, C++ was in the
weakest position, just like any pioneer.
via Digitalmars-d
2014-10-15 08:40:02 UTC
Permalink
Post by eles via Digitalmars-d
In defense of C++, beyond its C roots & compatibility, it also
have been the language that made the mistakes useful for the
other languages. That is, Java and C# capitalized on C++'s
mistakes by simply not repeating them. Of course, mistakes are
obvious only after they are made and, as such, C++ was in the
weakest position, just like any pioneer.
I guess you could say that, but the reality is that C++ has been
considered a bad language design from the start in academia. C++
wouldn't have had any chance without full C compatibility.

C++ is one more proof that installed based and gradual adoption
in combination with supporting "The Next Big Thing" (OO) is the
easy path to dominance. You could always defend using C++ by
saying that you used it as mostly C with some bells and whistles
(such as explicit inlining, overloading, vectors, complex numbers
etc), so you did not have to learn C++ to start using it if you
knew C. (Objective-C requires much more effort from the
programmer)

Java primarily capitalized on educational institutions having a
positive attitude towards SUN as a company. SUN was run by true
engineers. In addition Java was marketed as a language for the
web (which was hyped in the mid 90s) so educational institutions
got what they wanted:

1. A language that students would be motivated by, being able to
run programs in web browsers (which didn't turn out to work very
well in reality). It was common for universities to use clean
languages that nobody in the real world used.

2. A language that was simple, safe and had a garbage collector
and provided all the mechanisms needed to teach CS and OO (Java
was as close to Simula as you can get).

3. A language for which many educational books were being written
(important when you select a curriculum).

Once you get educational institutions to force feed students with
a language you win. I am not sure if Java would have survived
without it.

For some reason Microsoft did not make that strategic move until
much later. I think Bill Gates was the reason, MS pushed Visual
Basic too much to be taken seriously
 So eventually they had to
create their own incompatible "Java" (C#) in order to keep
collecting Windows-tax in the business environment.
Paulo Pinto via Digitalmars-d
2014-10-15 10:32:51 UTC
Permalink
On Wednesday, 15 October 2014 at 08:40:04 UTC, Ola Fosheim
Post by via Digitalmars-d
...
For some reason Microsoft did not make that strategic move
until much later. I think Bill Gates was the reason, MS pushed
Visual Basic too much to be taken seriously
 So eventually they
had to create their own incompatible "Java" (C#) in order to
keep collecting Windows-tax in the business environment.
An interesting thing for conspiracy theories is how close the new
Window Runtime model is from Ext-VOS.

Ext-VOS was the next architecture of COM, based on the idea that
all Windows languages would target it, as a common language
runtime.

Along the way, they decided to create the CLR instead.

Now the going native wave that hit Microsoft, has made them
create the Windows Runtime, having .NET compile to native code in
Windows Phone 8 and create the .NET Native, the ahead-of-time
native code compiler for .NET.

The main difference with Windows Native Runtime and the old
Ext-VOS, is the use .NET metadata instead of COM type libraries.

http://blogs.msdn.com/b/dsyme/archive/2012/07/05/more-c-net-generics-history-the-msr-white-paper-from-mid-1999.aspx


Java might as well have been, what made them move away from the
initial design.

--
Paulo
via Digitalmars-d
2014-10-15 14:41:21 UTC
Permalink
Post by Paulo Pinto via Digitalmars-d
Now the going native wave that hit Microsoft, has made them
create the Windows Runtime, having .NET compile to native code
in Windows Phone 8 and create the .NET Native, the
ahead-of-time native code compiler for .NET.
Yes, these moves are interesting to watch. Not sure how it will
turn out unless Microsoft truly embrace cross-platform
development.

On a related note I found these notes on the Go roadmap
interesting:

http://dotgo.sourcegraph.com/post/99652962343/brad-fitzpatrick-on-the-future-of-the-go-programming

Go 1.4:
- precise GC for everything
- start of Android support

Go 1.5:
- concurrent GC with marginal pauses (15ms?)
- start of iOS support
- cache-friendly scheduler ("NUMA")
- tracing in browser (Chrome)

And people are working on Go->PNACL and Go->Javascript compilers


I haven't really looked much at Go in the past two years, but it
looks like D has roughly 18 months to get the GC up to speed or
make programming without GC really comfy.

At some point quality of implementation, programmer productivity,
tools and platform support matters more than semantic details if
both language A and B can do roughly the same things.

IF the Go developers succeed in reaching their goals, which is a
gamble. But neither Google or Microsoft lack resources or the
motivation. So it all hangs on project management and strategic
thinking I think. :)

Competition and choice is a good thing. We'll see.
Paulo Pinto via Digitalmars-d
2014-10-15 17:10:54 UTC
Permalink
Am 15.10.2014 um 16:41 schrieb "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?=
Now the going native wave that hit Microsoft, has made them create the
Windows Runtime, having .NET compile to native code in Windows Phone 8
and create the .NET Native, the ahead-of-time native code compiler for
.NET.
Yes, these moves are interesting to watch. Not sure how it will turn out
unless Microsoft truly embrace cross-platform development.
http://dotgo.sourcegraph.com/post/99652962343/brad-fitzpatrick-on-the-future-of-the-go-programming
- precise GC for everything
- start of Android support
- concurrent GC with marginal pauses (15ms?)
- start of iOS support
- cache-friendly scheduler ("NUMA")
- tracing in browser (Chrome)
And people are working on Go->PNACL and Go->Javascript compilers

I saw that roadmap. It is also the confirmation that they won't ever add
generics.

So I guess, a better C it is.
I haven't really looked much at Go in the past two years, but it looks
like D has roughly 18 months to get the GC up to speed or make
programming without GC really comfy.
At some point quality of implementation, programmer productivity, tools
and platform support matters more than semantic details if both language
A and B can do roughly the same things.
IF the Go developers succeed in reaching their goals, which is a gamble.
But neither Google or Microsoft lack resources or the motivation. So it
all hangs on project management and strategic thinking I think. :)
Competition and choice is a good thing. We'll see.
They just got a victory today, as Microsoft is now bringing Docker to
Windows, which uses Go quite heavily.

Although for the time being they are being silent on what languages will
Microsoft be using.

Nick Stinemates from Docker

https://news.ycombinator.com/item?id=8458382
"As a result, it will be a community/maintainer decision what language
it's written in, but obviously we're heavily biased toward Go."

--
Paulo
via Digitalmars-d
2014-10-15 17:41:42 UTC
Permalink
Post by Paulo Pinto via Digitalmars-d
I saw that roadmap. It is also the confirmation that they won't
ever add generics.
So I guess, a better C it is.
It isn't all that great at the C-stuff, Go is no system level
language IMO.

But templates can always be added later. If Google manage to get
a solid GC based runtime up, one might write a new front end for
it. Just like people write new languages for JVM. (but it is
still a big "if")
Post by Paulo Pinto via Digitalmars-d
They just got a victory today, as Microsoft is now bringing
Docker to Windows, which uses Go quite heavily.
Docker is a nice idea. Not sure where Microsoft is going with it,
but they probably go for this to make Azure competitive.
Paulo Pinto via Digitalmars-d
2014-10-15 18:15:11 UTC
Permalink
Am 15.10.2014 um 19:41 schrieb "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?=
Post by Paulo Pinto via Digitalmars-d
I saw that roadmap. It is also the confirmation that they won't ever
add generics.
So I guess, a better C it is.
It isn't all that great at the C-stuff, Go is no system level language IMO.
I look at Go and see Oberon, hence my remark.

Even if that isn't the case, the only thing C is good at currently is
embedded devices low on RAM, device drivers and being a portable assembler.

For everything else, there are better alternatives.

--
Paulo
ketmar via Digitalmars-d
2014-10-15 18:23:56 UTC
Permalink
On Wed, 15 Oct 2014 20:15:11 +0200
Post by Paulo Pinto via Digitalmars-d
Even if that isn't the case, the only thing C is good at currently is
embedded devices low on RAM, device drivers and being a portable assembler.
and it sux as portable assembler.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141015/94e2812f/attachment-0001.sig>
via Digitalmars-d
2014-10-15 18:27:36 UTC
Permalink
Post by Paulo Pinto via Digitalmars-d
Even if that isn't the case, the only thing C is good at
currently is embedded devices low on RAM, device drivers and
being a portable assembler.
For everything else, there are better alternatives.
Portable libraries. It is a stable design that most languages can
interface with, so you can generally not go wrong by writing
libraries in C.

It is a pity that some cool libraries are C++ only (like 3D
physics), but maybe automatic source-to-source translation can do
well sometime in the future.
eles via Digitalmars-d
2014-10-15 18:29:34 UTC
Permalink
Post by Paulo Pinto via Digitalmars-d
Am 15.10.2014 um 19:41 schrieb "Ola Fosheim
On Wednesday, 15 October 2014 at 17:10:52 UTC, Paulo Pinto
Post by Paulo Pinto via Digitalmars-d
I saw that roadmap. It is also the confirmation that they
won't ever
add generics.
So I guess, a better C it is.
It isn't all that great at the C-stuff, Go is no system level
language IMO.
I look at Go and see Oberon, hence my remark.
Even if that isn't the case, the only thing C is good at
currently is embedded devices low on RAM, device drivers and
being a portable assembler.
For everything else, there are better alternatives.
Still..



Scott Meyers talk
Paulo Pinto via Digitalmars-d
2014-10-15 18:50:23 UTC
Permalink
Post by eles via Digitalmars-d
Post by Paulo Pinto via Digitalmars-d
Am 15.10.2014 um 19:41 schrieb "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?=
Post by Paulo Pinto via Digitalmars-d
I saw that roadmap. It is also the confirmation that they won't ever
add generics.
So I guess, a better C it is.
It isn't all that great at the C-stuff, Go is no system level language IMO.
I look at Go and see Oberon, hence my remark.
Even if that isn't the case, the only thing C is good at currently is
embedded devices low on RAM, device drivers and being a portable assembler.
For everything else, there are better alternatives.
Still..
http://youtu.be/ltCgzYcpFUI
Scott Meyers talk
This is C++, I am speaking about C.

C++ is part of my "there are better alternatives" list.

--
Paulo
via Digitalmars-d
2014-10-15 20:00:23 UTC
Permalink
Post by Paulo Pinto via Digitalmars-d
This is C++, I am speaking about C.
C++ is part of my "there are better alternatives" list.
Scott Meyers pointed out that C is the most popular open source
language still (which probably is true if you count lines of
code), and that the popularity of C is important for the
popularity of C++ today.

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
Paulo Pinto via Digitalmars-d
2014-10-15 20:35:55 UTC
Permalink
Am 15.10.2014 um 22:00 schrieb "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?=
Post by Paulo Pinto via Digitalmars-d
This is C++, I am speaking about C.
C++ is part of my "there are better alternatives" list.
Scott Meyers pointed out that C is the most popular open source language
still (which probably is true if you count lines of code), and that the
popularity of C is important for the popularity of C++ today.
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
Ah ok.

Yes, I do have to agree.

However that is mostly caused by the animosity in open source world
against C++.

I can still remember how it was to be on Gtkmm vs Gtk.

--
Paulo
via Digitalmars-d
2014-10-15 20:37:19 UTC
Permalink
Just for fun, some D tag stats from Stackoverflow for the last
week:

C++: 2080 this week
Go: 96 this week
Rust: 58 this week
D: 25 this month

Or (roughly):

C++: 357x more questions
Go: 16x
Rust: 10x
ketmar via Digitalmars-d
2014-10-15 20:48:08 UTC
Permalink
On Wed, 15 Oct 2014 20:37:19 +0000
Post by via Digitalmars-d
Just for fun, some D tag stats from Stackoverflow for the last
C++: 2080 this week
Go: 96 this week
Rust: 58 this week
D: 25 this month
C++: 357x more questions
Go: 16x
Rust: 10x
so, c++ is most complicated language, and D is so easy and nice that
people don't even asking questions.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141015/0d8c9bb1/attachment.sig>
via Digitalmars-d
2014-10-15 21:13:31 UTC
Permalink
On Wednesday, 15 October 2014 at 20:48:21 UTC, ketmar via
Post by ketmar via Digitalmars-d
so, c++ is most complicated language, and D is so easy and nice
that people don't even asking questions.
Yeah, top stars on github this month for D:

libasync: 22 stars
vibe.d: 15
phobos: 10
druntime: 8
dash: 9

For Go:

pup: 1243 stars
inspeqtor: 856
docker: 743
gopherjs: 659
syncthing: 584

For C++:

cool-retro-term: 999 stars
node-webkit: 690
CppCon2014: 615
cling: 512
ricochet: 498

On github Go appears to be on the same number of stars as C++ and
Python
 so I guess this could mean it is popular among hobbyists.
Ada projects have no stars...
Paulo Pinto via Digitalmars-d
2014-10-15 21:29:24 UTC
Permalink
Am 15.10.2014 um 23:13 schrieb "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?=
On Wednesday, 15 October 2014 at 20:48:21 UTC, ketmar via Digitalmars-d
.... Ada
projects have no stars...
Who needs stars when working on an enterprise budget? :)

Besides, Ada never was an hobbyist language. Only after GNAT Core
decided to release their compiler as GPL, universities decided to pay
attention.

--
Paulo
via Digitalmars-d
2014-10-15 23:17:53 UTC
Permalink
Post by Paulo Pinto via Digitalmars-d
Who needs stars when working on an enterprise budget? :)
Yeah, these metrics are skewed, but it is interesting to see what
kind of projects people get excited about in different languages.

I didn't expect Go to do so well on github. I found that
surprising.
Post by Paulo Pinto via Digitalmars-d
Besides, Ada never was an hobbyist language. Only after GNAT
Core decided to release their compiler as GPL, universities
decided to pay attention.
Ada is "industrial", and comes through as a bit syntax heavy for
casual use. Still, the feature set appears to fit well together
when reading about it.

Go on the other hand comes through as a bit arcane and the
defer/panic/recover error handling is kind of weird and the
syntax for it does not indicate that it is about errors. Which I
think is important to make distinct. So I have trouble liking Go
when browsing Go code for the same reason I'd never want to do
anything large in C. Then again, it took a while for me to get
used to C-style braces after being used to languages like Pascal.
So maybe it grows on you
 (doubt it).

Not that I like regular try/catch exceptions either. A more
efficient "transactional" approach to error-handling seems more
attractive. A solution where you don't sprinkle error-handling
code all over your codebase. It probably requires high-level
language support if you want to avoid the extra noise that
"plague" current error handling solutions
 :-/

eles via Digitalmars-d
2014-10-15 07:31:44 UTC
Permalink
consistency between 3rd party libraries. Java has spoiled me
While I agree with all this, I think the reason for Java's
developing smoothness is not portability as such, but the
unitarity of it.

This is exactly how Bjarne puts it: "Java is not portable over
platforms, Java is *a platform*."

Which is quite true, might it be not interesting for some
applications. In a way is just like one would brag about Windows
apps portability on the grounds that all operating systems
support Virtualbox...
Paulo Pinto via Digitalmars-d
2014-10-15 08:29:51 UTC
Permalink
Post by eles via Digitalmars-d
consistency between 3rd party libraries. Java has spoiled me
While I agree with all this, I think the reason for Java's
developing smoothness is not portability as such, but the
unitarity of it.
This is exactly how Bjarne puts it: "Java is not portable over
platforms, Java is *a platform*."
Which is quite true, might it be not interesting for some
applications. In a way is just like one would brag about
Windows apps portability on the grounds that all operating
systems support Virtualbox...
This is common to any language that offers a rich runtime that
abstracts away over OS specific issues, while allowing you to
jump into the OS when required to do so.

C and C++ fail at this, because C's notion of runtime is called
UNIX and C++ followed along, to cater to the same crowd.

That standard runtime never managed into the language standard
and instead became a standard of its own, POSIX.

With the caveat that not every OS out there implements POSIX
(there are others besides Windows that don't), and those that do,
don't have 100% the same version.

This is exactly the reason why C++ standardization group is now
trying to get the same form of plaftorm abstractions into the
standard, that other languages enjoy.

--
Paulo
Paulo Pinto via Digitalmars-d
2014-10-14 19:35:54 UTC
Permalink
Post by eles via Digitalmars-d
Post by eles via Digitalmars-d
http://www.horstpeterhermann.de/ada_related/gems.html
This one reminded me D, with some hints about what could still be
http://www.adacore.com/adaanswers/gems/ada-gem-7/
Hijack, also OT: using C++ without memory management
http://engineering.adap.tv/listing/why-we-use-c-without-using-stl-or-boost/
But with buffer overruns and memory corruption.

--
Paulo
Loading...