Found D in the strangest of places... Right under the letter D

2018-07-29 Thread Sameer Pradhan via Digitalmars-d
By some bizarre coincidence, or rightfully so, an (somewhat 
artificial attempt at a cleanroom-ish) unbiased attempt to find 
out what Google associates with each letter of the English 
alphabet, someone with extra time on their hands at BBC's 
technology department, I was pleasantly surprised to find, found 
D (language) to be the highest ranked single character Google 
search result for D, in good company, right next to the letter 
(and language) C.


The article (link below) is titled "Google: An A to Z of search 
results"


http://www.bbc.co.uk/news/technology-44725867

All I can think was—"D is going places"

PS:  Apologies for the excessive parentheticals. In an attempt to 
convey my precise thoughts, I might have murdered English Grammar 
and rendered the post incomprehensible. Although being humans—as 
opposed to an (NLP) bot—you should be able to get the point one 
way or the other.


--
Sameer



Re: Looking for the article comparing D to Ada and others

2018-07-27 Thread Sameer Pradhan via Digitalmars-d
I had no idea of the DoD's Steelman requirements 
(https://en.wikipedia.org/wiki/Steelman_language_requirements)


I found another documents that has the same table that was on the 
website listed in an earlier post.  Here are the individual links:


https://www.dwheeler.com/steelman/steeltab.htm
http://jedbarber.id.au/steelman.html

I thought it might be nice to combine those two tables in one 
below.


D is really up there!

|--++-++-+|
| Language | No | Partial | Mostly | Yes | Mostly/Yes |
|--++-++-+|
| D|  7 |  15 | 25 |  66 |81% |
| Parasail | 11 |   6 | 11 |  85 |85% |
| Pascal   | 19 |  16 | 11 |  67 |69% |
| Rust | 12 |  19 | 23 |  59 |73% |
|--++-++-+|
| Ada  |  3 |   5 | 11 |  94 |93% |
| C| 32 |  21 | 16 |  44 |53% |
| C++  | 19 |  17 | 23 |  54 |68% |
| Java | 20 |  12 | 22 |  59 |72% |
|--++-++-+|


--
Sameer



Re: Whence came UFCS?

2018-07-27 Thread Sameer Pradhan via Digitalmars-d
Wow! I am glad to see so many responses!  Thanks for your 
indulgence.


So, to summarize, the concept (no pun intended) has been around 
for a while in D---originally in the context of arrays. It just 
might have been a bug, or an unintended side-effect. I intend to 
read the archival posts and might have something to say later.


--
Sameer

PS: I realize that I am a stickler for history, or rather 
historical contexts related to technology or research that I am 
involved in, and more recently regarding programming language 
concepts.  The culprit is probably the fact that I have been 
teaching programming languages course (or, taught one semester of 
it, and plan to teach it again in Spring) which has allowed me to 
learn of the origins of so many concepts which we sometimes take 
for granted today, but were part of some old languages.


PS1: I didn't want to respond to a particular thread, but there 
is no way in this forum to write a generic response to multiple 
posts so I am picking one as the anchor.


Whence came UFCS?

2018-07-26 Thread Sameer Pradhan via Digitalmars-d
During our Boston D Meetup today, we went through and 
deconstructed Walter's wonderfully elegant blog post from 2012 
called "Component Programming in D"


http://www.drdobbs.com/article/print?articleId=240008321&siteSectionName=architecture-and-design

I stumbled upon this gem (and another score or so articles on the 
digital mars site) a few days back, while following various 
hyperlinks, within and around the blog on Walter's take on what 
was C's biggest mistake which has been getting a lot of comments 
over the past few days.


This post which I have been trying to digest bit-by-bit over the 
past few days, made me realize why I fell in love with D in the 
first place. To top it all, Steven played a lightening talk from 
2018, called "values as types" by Andreas 
(https://youtu.be/Odj_5_pDN-U?t=21m10s) which is a parody on C++ 
and is so utterly ludicrous, we could not stop laughing.  Anyway, 
back to the point.


During the same period, but independent of the thread on C's 
mistake, I found that Kotlin has something called "Extension 
Functions" and "Extension Properties" 
(https://kotlinlang.org/docs/reference/extensions.html) via. the 
following article on Medium


https://medium.com/@magnus.chatt/why-you-should-totally-switch-to-kotlin-c7bbde9e10d5

Specifically Item #14.

What I saw/read seemed eerily familiar. Almost like a "wolf in 
sheeps clothing". The example screamed of UFCS.  Then, later, 
while reading the above Kotlin documentation, I saw a reference 
being made to similar functionality in C# and Gosu (apparently a 
programming language that I have never heard of before today) 
called Extensions.


Furthermore, I found that Project Lombok 
(https://projectlombok.org/features/experimental/ExtensionMethod) 
has tried to make this idiom/functionality available in Java 
through a @ExtensionMethod annotation. This also almost exactly 
represent UFCS functionality, though much more cludgy, I must say.


Therefore, after reading the word "Extension" in three different 
contexts, I started wondering and various questions came to mind, 
starting with---Whence came UFCS?


a. Did Walter and/or Andrei invent it independently of C#?
b. Was it called UFCS in some other language?
c. Were they not aware of Extensions when they coined UFCS?
d. Are UFCS and Extensions really one and the same thing?
e. If not, what is/are the difference(s)?  And is this why a 
different term/acronym was coined?


As far as I can tell a Google search on UFCS leads to only 
material on D and a Wikipedia entry mentioning Stroustrup and 
Sutter's proposal from 2016 to extend C++ to have this facility. 
It is likely that the Wikipedia article is severely incomplete in 
its historical connections as there is no mention of C# or that 
of Walter's 2012 Dr. Dobbs post which already lists it towards 
the end---in the list of features that D has which allows the 
creation of elegant components---among other dozen or so features.


In the end I thought I might as well dump my thoughts on the D 
forum and hear straight from the horse's (or horses') 
mouth(s)---so to speak.


--
Sameer



Re: D on top of Hacker News!

2018-06-04 Thread Sameer Pradhan via Digitalmars-d

On Sunday, 3 June 2018 at 20:12:03 UTC, JakubJ wrote:

On Sunday, 3 June 2018 at 16:58:23 UTC, Sameer Pradhan wrote:

It was nice to read Walter's article from 2014...
Wonder who posted it, and how long it will stay in the 
visibility range, but it was a nice feeling to see it at the 
top.


--
Sameer


Hi Sameer, I just discovered it today and posted it afterwards. 
Then, looked into this forum and surprise ;) .


:-)

However, I don't plan on jumping into D right now because I'm 
starting to use Elixir/OTP seriously at GSoC and between that 
and the finals at uni there's little time left.


In case you missed it, Walter did an AMA and answered some of the 
issues raised in the HN comments.




D on top of Hacker News!

2018-06-03 Thread Sameer Pradhan via Digitalmars-d

It was nice to read Walter's article from 2014...
Wonder who posted it, and how long it will stay in the visibility 
range, but it was a nice feeling to see it at the top.


--
Sameer


Re: D as a college language

2018-05-08 Thread Sameer Pradhan via Digitalmars-d

On Saturday, 5 May 2018 at 07:37:29 UTC, Walter Bright wrote:

On 5/4/2018 4:35 AM, Sjoerd Nijboer wrote:
Since D seems to be a language that supports a lot of 
programming

paradigms very well, wouldn't it be beneficial to learn people
declarative programming using D for a little and from there 
expose them
to other programming styles in thesame language to lower the 
barrier of

entry?


I agree that D being a multi-paradigm language makes it ideal 
as a vehicle for teaching various paradigms. New paradigms can 
be taught without the diversion of having to start over 
learning a new language.


Walter,

I am considering teaching the programming languages course again 
in Spring but this time simply using D.


Would you be willing to provide me with some advise in the 
process of converting the one that I had put together based on 
Dan Grossman's course at UW and which used SML and Python in 
addition to D. (Dan uses SML, Racket and Ruby). I would like to 
know if I can purely use D, or at least minimize the use of the 
two other languages without sacrificing the insights provided by 
those two languages.


Your response indicates that you have a very positive outlook on 
such a transition and I could help knowing that I am not 
compromising on the quality of the student's learning experience.


--
Sameer


Re: D as a college language

2018-05-05 Thread Sameer Pradhan via Digitalmars-d

On Friday, 4 May 2018 at 11:35:22 UTC, Sjoerd Nijboer wrote:
So i'm a college student in and what bothers me is that there 
seem to kind of assume programming languages don't evolve or 
don't get replaced by better ones.
Right now if you go to college you'll most likely get tought 
c++, c# or java for any comp sci degree. While these languages 
are industrial standards, they all have their drawbacks. And 
one drawback that looks important for teaching is flexibility 
in expressiveness.


From my experience college students seem to have problems 
translating their often declarative thought process into actual 
semi compile-able code that runs in a given language.
Since D seems to be a language that supports a lot of 
programming paradigms very well, wouldn't it be beneficial to 
learn people declarative programming using D for a little and 
from there expose them to other programming styles in thesame 
language to lower the barrier of entry?


I think D could play a bigger role in education since its such 
a "clean" language that is flexible but doesn't have any real 
gotcha "features". Its also a language that could potentially 
be used over someones entire college career as the primary 
language. If this would be achieved there would be a higher 
income flow into the industry of young D programmers which will 
pollute other programmers with the D mind and featureset.


I thought it might help if I mentioned that I successfully used D 
as one of three languages to teach the Programming Languages 
course at Vassar College last Fall.


The main reason I ended up using three languages was this:

1. Most undergraduate CS courses that I sampled (at UW, for one 
taught by Dan Grossman, among others) use a core functional 
programming language such as (S)ML which really helps in 
solidifying some of the principles of programming languages—the 
concept of environment, scope, binding; functions as values; 
curry, filter, map, etc. Plus it has a version that comes with a 
REPL and really helps students explore it. That said, it is not a 
"industrial strength" language, and since I also wanted to 
empasize on the pragmatic aspects, it could not be the only one.


2. I briefly introduced the concept of logic programming using 
Prolog, but I couldn't really spend too much time on it and so 
cannot count it as another language


3. When I asked students what language they would like to 
choose—given the choice, most of the class leaned towards Python. 
 That plus the likelihood of them actually using it at some 
point, I decided to cover some programming language aspects using 
it over two-three weeks. It also has some fascinating feature 
sets (dunder methods, some meta programming niceties, etc.) and 
being interpreted language, provides a nice complementary view.


4. The rest of the course used D.  I used both Andrei 
Alexandrescu's book and Ali's book to generate the course 
content. I was fortunate to have a stack of slides from the 
Andrei himself. And even more fortunate, as it happened to spend 
a Boston D meetup dinner with the two and Steven Schv-guy.


I have been in love with D ever since I firsr started reading 
Andrei's book in 2010, and it was really quite something that I 
could use it in an undergraduate CS curriculum seven years later.


Originally, I was hoping to use D for the entire course, but then 
given various aspects of the course, and the styles in which it 
is being taught many places made me change things a bit.  Oh, and 
I should mention that I did get a few slides from Chuck Allison 
who uses D to teach a small part of his course at UVU. If you 
haven't seen his talk at, I believe the first/second DConf

at UVU, I would highly recommend it.

The icing on the cake was that Andrei was able to visit Vassar in 
November and give a talk on his Fastware muse (if I may call it 
that). He was an instant success!


I am scheduled to teach the course again next Spring, and I am 
trying to figure out how/if I can use more D than I did the last 
time without sacrificing some of the goodness that (S)ML brings 
to the table. That way I can cover more programming paradigms 
that D brings to life—built in unittests, contract programming, 
delegates, and many many more—with a flair.


Any thoughts/pointers that this wonderful community can provide 
would be very much appreciated.


--
Sameer


Re: Ali's slides from his C++Now talk

2017-06-16 Thread Sameer Pradhan via Digitalmars-d

On Tuesday, 23 May 2017 at 23:31:48 UTC, Joakim wrote:

Enjoying going through these:

http://ddili.org/AliCehreli_CppNow_2017_Competitive_Advantage_with_D.no_pause.pdf

Ali really has a gift for explaining stuff, we're lucky to have 
him.


I must say that I really enjoyed the slides as well! Hopefully 
will get to watching the video at some point.


--
Sameer





Re: [your code here]

2016-12-01 Thread Sameer Pradhan via Digitalmars-d

On Thursday, 1 December 2016 at 14:26:11 UTC, ringo starr wrote:

swello.edu


This post screams Captcha!
Just to make sure it was not a false positive, I went to the 
(non-existent) URL. On the bright side, the forum seems to be 
widely circulated—enough to attract spammers!
As far as I can tell, spamming this list is not quite 
straightforward to begin with...


Yay, D!

--
Sameer


Re: Mir GLAS is a C library and passes Natlib's test suite! And questions :-)

2016-10-28 Thread Sameer Pradhan via Digitalmars-d

On Friday, 28 October 2016 at 06:31:19 UTC, Ilya Yaroshenko wrote:
On Friday, 28 October 2016 at 03:44:05 UTC, Andrei Alexandrescu 
wrote:

On 10/27/16 3:59 AM, Ilya Yaroshenko wrote:

[...]


I must plead ignorance on the finer interface details, but from 
what I am reading this seems like an amazing development. I am so 
happy that that D has a solid base for GPU work.


The post from a few weeks back with performance details compared 
to BLAS and others was quite impressive. details I was just 
telling Steve at the Boston meetup yesterday that libmir and now 
MirGLAS has really made me jump up and down to start using D 
seriously for some language processing work I have been hoping to 
use it for. I have been an observer and reader for several years 
now, but haven't taken the leap. Yet. Hopefully soon...


--
Sameer




[...]


Cool work!

One thing I'd want to understand is how to use Mir GLAS from 
within D itself. If it's a straight C interface, there seems 
to be a fair amount of friction (we have a D program 
communicating with a D library through the uncomfortable 
confines of a C interface). Is that the case? Should there be 
a way to short circuit the C API and use a more expressive D 
interface? (Looking e.g. at Eigen, it's meant to allow people 
using it from C++ to take advantage of a C++-specific smooth 
interface.)


GLAS has 2 APIs: GLAS(ndslise) and BLAS(fortran).
Both APIs has C/C++ and D headers. D headers contains aliases 
with unified names like in core.stdc.tgmath. So, extern(C) 
interface for GLAS is comfortable and looks like:


gemm(alpha, a, b, beta, c); // calls glas_?gemm

The latest ndslice PR to stable branch solves a problem in case 
of const and immutable a and b. 
https://github.com/dlang/phobos/pull/4873


GLAS does not have syntax like Eigen, i mean

c = a * b;

This syntax can be a part of another package for scripting like 
syntax.
See also Q&A 
https://github.com/libmir/mir-glas#why-glas-does-not-have-lazy-evaluation-and-aliasing-like-eigen



[...]


I guess I'd like to understand the dynamics better here.


The main reason is compilation time (1 secs+) and template 
bloat (50 KB +). OpenBLAS size is more than 20 MB. GLAS is 
smaller, but it is not something lightweight like `sort`.
Assume you are buildings a large D projects one-by-one file in 
parallel. It can be builded during minutes and its size can be

>100 MB, only because GLAS.

So, having an extern(C) layers is good practice to keep 
interface clear and compile time small.



[...]


You have all support from Walter and myself for integrating 
GLAS with Phobos. Before that I'd want to make sure we slice 
and dice things properly.


Awesome! I am happy to read this)


[...]


That would be an interesting precedent. We should talk about 
it next week. (My knee-jerk reaction is if we're worth our 
salt we should release Phobos often enough to obviate the need 
for this. But the notion of hot-swapping subcomponents is cool 
too.)


Some concepts can be found on a slides from my today's talk
https://docs.google.com/presentation/d/1w1cQ8vDluglRIt8Qdnm-sY7kqxoKZxbPEWW6tR3lPpo/edit?usp=sharing


Thanks,

Andrei


Best regards,
Ilya


Re: Interest in Boston area D meetups?

2016-05-22 Thread Sameer Pradhan via Digitalmars-d
On Tuesday, 17 May 2016 at 13:17:35 UTC, Steven Schveighoffer 
wrote:
Is anyone interested in having D meetups in Boston area? I'm 
not familiar with really any other locals (well, there is one 
person I know of :)


-Steve


I would love to be part of the Boston D community.
Maybe we can meet on/near the D line?
Could not help making a pun. :-)

--
Sameer




Re: [OT] On Giving Presentations

2016-05-22 Thread Sameer Pradhan via Digitalmars-d

On Sunday, 22 May 2016 at 18:35:16 UTC, Walter Bright wrote:

http://alumni.media.mit.edu/~cahn/life/gian-carlo-rota-10-lessons.html#expository

A lot of us wind up giving presentations now and then, and all 
of us can improve. This article has some great advice, and is a 
good read, too.


Very nice pointer. Although it is 20 years old (from circa 1996), 
it still makes so much sense.


--
Sameer