On Friday, 18 January 2019 at 20:29:08 UTC, H. S. Teoh wrote:
That would work, but it would also suffer from all the same
problems as macro-based programming in C. The compiler would
be unable to detect when you accidentally pasted type names
together where you intended to be separate, the
On Friday, 18 January 2019 at 20:03:48 UTC, Mark wrote:
[...]
Represent types as strings, CTFE them as you see fit, and
output a string that can then be mixin'ed to use the actual
type. :)
Two problems:
1) Mixing in a string is unhygienic. If two modules (or two
scopes in the same module)
On Friday, 18 January 2019 at 20:32:35 UTC, Jacob Carlborg wrote:
On 2019-01-18 20:28, Stefan Koch wrote:
The only difference that type-functions have from what you
describe is that it does not need to occupy a keyword 'type'.
You're using "alias" instead of my "type" keyword?
yes. After
On 2019-01-18 20:28, Stefan Koch wrote:
The only difference that type-functions have from what you describe is
that it does not need to occupy a keyword 'type'.
You're using "alias" instead of my "type" keyword?
--
/Jacob Carlborg
On Fri, Jan 18, 2019 at 08:03:48PM +, Mark via Digitalmars-d-announce wrote:
[...]
> Why not do away with AliasSeq and use strings all the way?
>
> string Constify(string type)
> {
> // can add input checks here
> return "const(" ~ type ~ ")";
> }
>
> void main()
> {
> import
On Thursday, 17 January 2019 at 20:47:38 UTC, Steven
Schveighoffer wrote:
well, there was no static foreach for that article (which I
admit I didn't read, but I know what you mean).
But it's DEFINITELY not as easy as it could be:
import std.conv;
alias AliasSeq(P...) = P;
template
On Friday, 18 January 2019 at 10:23:11 UTC, Jacob Carlborg wrote:
On 2019-01-17 23:44, H. S. Teoh wrote:
YES! This is the way it should be. Type-tuples become first
class
citizens, and you can pass them around to functions and return
them from
functions
No no no, not only type-tuples, you
On Fri, Jan 18, 2019 at 11:23:11AM +0100, Jacob Carlborg via
Digitalmars-d-announce wrote:
> On 2019-01-17 23:44, H. S. Teoh wrote:
>
> > YES! This is the way it should be. Type-tuples become first class
> > citizens, and you can pass them around to functions and return them
> > from functions
On Thu, Jan 17, 2019 at 05:32:52PM -0800, Walter Bright via
Digitalmars-d-announce wrote:
> On 1/17/2019 11:31 AM, H. S. Teoh wrote:
> > [...]
>
> Thanks for the thoughtful and well-written piece.
>
> But there is a counterpoint: symmetry in mathematics is one thing, but
> symmetry in human
On 2019-01-17 23:44, H. S. Teoh wrote:
Interesting. Is it possible to assign a "fake" mangle to type functions
that never actually gets emitted into the object code, but just enough
to make various internal compiler stuff that needs to know the mangle
work properly?
Not sure that would be
On 2019-01-17 23:44, H. S. Teoh wrote:
YES! This is the way it should be. Type-tuples become first class
citizens, and you can pass them around to functions and return them from
functions
No no no, not only type-tuples, you want types to be first class
citizens. This makes it possible to
On 1/17/2019 11:31 AM, H. S. Teoh wrote:
[...]
Thanks for the thoughtful and well-written piece.
But there is a counterpoint: symmetry in mathematics is one thing, but symmetry
in human intuition is not. Anytime one is dealing in human interfaces, one runs
into this. I certainly did with
On 1/17/2019 8:06 AM, bpr wrote:
Was that a pre C++11 version of C++, or a more modern one?
pre C++11
On Thursday, 17 January 2019 at 22:44:08 UTC, H. S. Teoh wrote:
On Thu, Jan 17, 2019 at 10:20:24PM +, Stefan Koch via
Digitalmars-d-announce wrote:
P.S. There is one caveat: because of how type-functions work
they cannot, you cannot create a non-anonymous symbol inside a
type-function,
Am 17.01.19 um 23:20 schrieb Stefan Koch:
> For 2 years I have pondered this problem, and I did come up with a
> solution.
> It's actually not that hard to have CTFE interact with type-tuples.
> You can pass them as function parameters, or return them if you wish.
> Of course a type-tuple
On Thu, Jan 17, 2019 at 10:20:24PM +, Stefan Koch via
Digitalmars-d-announce wrote:
> On Thursday, 17 January 2019 at 19:31:24 UTC, H. S. Teoh wrote:
[...]
> > Coming back to the D example at the end, I totally agree with the
> > sentiment that D templates, in spite of their significant
> >
On Thursday, 17 January 2019 at 19:31:24 UTC, H. S. Teoh wrote:
On Thu, Jan 17, 2019 at 06:03:07PM +, Paul Backus via
Digitalmars-d-announce wrote: [...]
[2]
https://bartoszmilewski.com/2009/10/21/what-does-haskell-have-to-do-with-c/
[...]
Coming back to the D example at the end, I
On 1/17/19 2:31 PM, H. S. Teoh wrote:
On Thu, Jan 17, 2019 at 06:03:07PM +, Paul Backus via
Digitalmars-d-announce wrote:
[...]
[2]
https://bartoszmilewski.com/2009/10/21/what-does-haskell-have-to-do-with-c/
[...]
Haha, seems D did better than C++ in this respect, but not quite at the
On Thu, Jan 17, 2019 at 06:03:07PM +, Paul Backus via
Digitalmars-d-announce wrote:
[...]
> [2]
> https://bartoszmilewski.com/2009/10/21/what-does-haskell-have-to-do-with-c/
[...]
Haha, seems D did better than C++ in this respect, but not quite at the
level of Haskell.
The C++ example of a
On Thursday, 17 January 2019 at 16:06:39 UTC, bpr wrote:
On Thursday, 17 January 2019 at 01:59:29 UTC, Walter Bright
wrote:
Bartosz Milewski is a C++ programmer and a Haskell fan. He
once gave a presentation at NWCPP where he wrote a few lines
of Haskell code. Then, he showed the same code
On Thursday, 17 January 2019 at 01:59:29 UTC, Walter Bright wrote:
On 1/16/2019 4:19 PM, H. S. Teoh wrote:
On Wed, Jan 16, 2019 at 11:43:19PM +, John Carter via
Digitalmars-d-announce wrote:
[...]
Yes, that's one of the outstanding qualities of D, and one
that I was
immensely impressed
On Thu, Jan 17, 2019 at 11:17:18AM +, Tony via Digitalmars-d-announce wrote:
> On Sunday, 13 January 2019 at 04:04:14 UTC, Walter Bright wrote:
>
> > One major takeaway is that the bugs/line are the same regardless of
> > the language used. This means that languages that enable more
> >
On Sunday, 13 January 2019 at 04:04:14 UTC, Walter Bright wrote:
One major takeaway is that the bugs/line are the same
regardless of the language used. This means that languages that
enable more expression in fewer lines of code result in fewer
bugs for the same functionality.
Is the data
On Wed, Jan 16, 2019 at 05:59:29PM -0800, Walter Bright via
Digitalmars-d-announce wrote:
[...]
> Bartosz Milewski is a C++ programmer and a Haskell fan. He once gave a
> presentation at NWCPP where he wrote a few lines of Haskell code.
> Then, he showed the same code written using C++ template
>
On Thursday, 17 January 2019 at 01:59:29 UTC, Walter Bright wrote:
Bartosz Milewski is a C++ programmer and a Haskell fan. He once
gave a presentation at NWCPP where he wrote a few lines of
Haskell code. Then, he showed the same code written using C++
template metaprogramming.
The Haskell
On 1/16/2019 4:19 PM, H. S. Teoh wrote:
On Wed, Jan 16, 2019 at 11:43:19PM +, John Carter via
Digitalmars-d-announce wrote:
...I do find it remarkable that I can read the d code quite easily
without reaching for the reference manual, but to make sense of his
C++, it sends me trawling
On 1/16/2019 3:43 PM, John Carter wrote:
Somebody on the C++ side has written a reply
https://brevzin.github.io/c++/2019/01/15/if-constexpr-isnt-broken/
From the article:
D (with corrections):
static if (maxLength < 0xFFFE) {
alias CellIdx = uint16_t;
} else {
alias CellIdx
On Wed, Jan 16, 2019 at 11:43:19PM +, John Carter via
Digitalmars-d-announce wrote:
[...]
> Given that I have probably written a lot more C++ code in my life than
> d...
>
> ...I do find it remarkable that I can read the d code quite easily
> without reaching for the reference manual, but to
On Saturday, 12 January 2019 at 15:51:03 UTC, Andrei Alexandrescu
wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
Now as to the talk, as you could imagine, it touches on another
Somebody on the C++ side has written a reply
On 1/16/19 11:43 AM, Paolo Invernizzi wrote:
On Wednesday, 16 January 2019 at 16:30:17 UTC, Steven Schveighoffer wrote:
On 1/16/19 10:06 AM, Paolo Invernizzi wrote:
I'm waiting, for example, for a revamp of IO, just to start...
We're working on it...
https://github.com/schveiguy/iopipe
On Wednesday, 16 January 2019 at 16:30:17 UTC, Steven
Schveighoffer wrote:
On 1/16/19 10:06 AM, Paolo Invernizzi wrote:
I'm waiting, for example, for a revamp of IO, just to start...
We're working on it...
https://github.com/schveiguy/iopipe
https://github.com/MartinNowak/io
-Steve
I was
On 1/16/19 10:06 AM, Paolo Invernizzi wrote:
I'm waiting, for example, for a revamp of IO, just to start...
We're working on it...
https://github.com/schveiguy/iopipe
https://github.com/MartinNowak/io
-Steve
On Wednesday, 16 January 2019 at 14:59:20 UTC, Steven
Schveighoffer wrote:
On 1/15/19 4:37 AM, Martin Tschierschke wrote:
[...]
I should have said that your point is mostly correct, just that
this is a bad example :)
I've looked for ORM on code.dlang.org, and never found one yet
that I
On 1/15/19 4:37 AM, Martin Tschierschke wrote:
On Monday, 14 January 2019 at 18:52:02 UTC, Jacob Carlborg wrote:
On 2019-01-14 15:42, Steven Schveighoffer wrote:
That's a bad example :) The clear answer is mysql-native, which is
what vibe.d recommends.
Exactly, and I don't need five minutes
On Wednesday, 16 January 2019 at 11:35:15 UTC, Dejan Lekic wrote:
On Monday, 14 January 2019 at 10:18:34 UTC, Martin Tschierschke
wrote:
This is exactly the argument to get a database driver
(mysql,postgres...) and probably a webserver in std.
Absolutely not! Please...
IMHO, what needs to
On Monday, 14 January 2019 at 10:18:34 UTC, Martin Tschierschke
wrote:
This is exactly the argument to get a database driver
(mysql,postgres...) and probably a webserver in std.
Absolutely not! Please...
IMHO, what needs to be in std are just APIs (modules, interfaces,
declarations)...
On 1/15/2019 11:39 AM, 12345swordy wrote:
If there were a dip that involves
deprecating class,
I wouldn't worry about that getting very far :-)
On 2019-01-16 06:32, Walter Bright wrote:
You deliberately wrote that, and I'm confident you'd never try to pass
that off as good work.
Yes. I'm showing it's possible to write bad code in all programming
languages with all (most) features. Macros are not required for that.
With macros,
On 2019-01-16 08:08, Nicholas Wilson wrote:
I'm pretty sure Jacob is talking about a completely different type of
macro (i.e. not textual substitution), AST macros.
Yeah, I should come up with a new name than "macro". A soon as Walter
sees the word "macro", regardless of its meaning in the
On 1/15/2019 11:08 PM, Nicholas Wilson wrote:
I'm pretty sure Jacob is talking about a completely different type of macro
(i.e. not textual substitution), AST macros.
I understand he means AST macros, but they aren't fundamentally different in the
characteristic I'm talking about.
I'd be
On Wednesday, 16 January 2019 at 05:32:51 UTC, Walter Bright
wrote:
On 1/15/2019 10:39 AM, Jacob Carlborg wrote:
Perhaps we shouldn't support user defined types or functions
either ;)
You deliberately wrote that, and I'm confident you'd never try
to pass that off as good work.
With macros,
On 1/15/2019 10:39 AM, Jacob Carlborg wrote:
Perhaps we shouldn't support user defined types or functions either ;)
You deliberately wrote that, and I'm confident you'd never try to pass that off
as good work.
With macros, however, programmers are convinced they are creating models of
On Tuesday, 15 January 2019 at 17:29:12 UTC, welkam wrote:
On Tuesday, 15 January 2019 at 11:59:58 UTC, Atila Neves wrote:
He's not saying "kill classes in D", he's saying an OOP system
in D could be implemented from primitives and classes don't
need to be a language feature, similar to CLOS
On 2019-01-15 12:53, Walter Bright wrote:
Template expressions can't, either, but what they do is hijack the
syntax for completely different purposes. The poor reader will be
looking at code, and it will behave nothing like the syntax suggests.
Ah, you mean like this:
struct MyInt
{
On Tuesday, 15 January 2019 at 11:59:58 UTC, Atila Neves wrote:
He's not saying "kill classes in D", he's saying an OOP system
in D could be implemented from primitives and classes don't
need to be a language feature, similar to CLOS in Common Lisp.
For some people writing OOP means writing
On Tue, 15 Jan 2019 11:59:58 +, Atila Neves wrote:
> He's not saying "kill classes in D", he's saying an OOP system in D
> could be implemented from primitives and classes don't need to be a
> language feature, similar to CLOS in Common Lisp.
As long as the syntax and behavior don't change,
On Monday, 14 January 2019 at 14:59:03 UTC, 12345swordy wrote:
On Monday, 14 January 2019 at 10:06:48 UTC, Mike Franklin wrote:
On Monday, 14 January 2019 at 05:31:27 UTC, Paul Backus wrote:
[...]
I think D's structs are a sufficient object system for such a
focal point. With design by
On 1/15/2019 1:10 AM, Jacob Carlborg wrote:
The AST macros I've been talking about have never been able to create new
syntax.
Template expressions can't, either, but what they do is hijack the syntax for
completely different purposes. The poor reader will be looking at code, and it
will
On Monday, 14 January 2019 at 18:52:02 UTC, Jacob Carlborg wrote:
On 2019-01-14 15:42, Steven Schveighoffer wrote:
That's a bad example :) The clear answer is mysql-native,
which is what vibe.d recommends.
Exactly, and I don't need five minutes for that. Five seconds
is enough :)
Ok, bad
On 2019-01-14 23:52, Walter Bright wrote:
On 1/14/2019 10:49 AM, Jacob Carlborg wrote:
But Ddoc has macros ;)
Indeed it does. But the macros cannot be used to create syntax, and
there is no token concatenation. Macros cannot define other macros.
The AST macros I've been talking about
On Tuesday, 15 January 2019 at 06:57:28 UTC, Paul Backus wrote:
On Tuesday, 15 January 2019 at 05:18:45 UTC, aliak wrote:
Quote from article:
"The languages with the strongest positive coefficients -
meaning associated with a greater number of defect fixes are
C++, C, and Objective-C, also
On Tuesday, 15 January 2019 at 05:18:45 UTC, aliak wrote:
Quote from article:
"The languages with the strongest positive coefficients -
meaning associated with a greater number of defect fixes are
C++, C, and Objective-C, also PHP and Python. On the other
hand, Clojure, Haskell, Ruby and
On Saturday, 12 January 2019 at 15:51:03 UTC, Andrei Alexandrescu
wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
If nothing else please watch the opening story, it's true and
quite funny :o).
Now as to the talk, as you could imagine, it touches on another
language as well...
Andrei
On Mon, 14 Jan 2019 21:12:48 +, Paul Backus wrote:
> On Monday, 14 January 2019 at 21:08:50 UTC, Ben Jones wrote:
>> Is it possible to declare a function whose name is a CTFE computed
>> string?
>
> Yes, if you do it with a string mixin.
And more simply, you can declare a function with a
On 1/14/2019 10:49 AM, Jacob Carlborg wrote:
But Ddoc has macros ;)
Indeed it does. But the macros cannot be used to create syntax, and there is no
token concatenation. Macros cannot define other macros.
On Monday, 14 January 2019 at 21:22:32 UTC, Andre Pany wrote:
On Monday, 14 January 2019 at 21:08:50 UTC, Ben Jones wrote:
On Saturday, 12 January 2019 at 15:51:03 UTC, Andrei
Alexandrescu wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
If nothing else please watch the opening story, it's true
On Monday, 14 January 2019 at 21:08:50 UTC, Ben Jones wrote:
On Saturday, 12 January 2019 at 15:51:03 UTC, Andrei
Alexandrescu wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
If nothing else please watch the opening story, it's true and
quite funny :o).
Now as to the talk, as you could
On Monday, 14 January 2019 at 21:08:50 UTC, Ben Jones wrote:
Is it possible to declare a function whose name is a CTFE
computed string?
Yes, if you do it with a string mixin.
On Saturday, 12 January 2019 at 15:51:03 UTC, Andrei Alexandrescu
wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
If nothing else please watch the opening story, it's true and
quite funny :o).
Now as to the talk, as you could imagine, it touches on another
language as well...
Andrei
A
On Mon, Jan 14, 2019 at 08:38:39PM +, Guillaume Piolat via
Digitalmars-d-announce wrote:
[...]
> Other people often lack interest because of real or perceived template
> bloat, and it's critical.
>
> - I think it's important to emphasize CTFE over template
> instantiations because (per
On Saturday, 12 January 2019 at 15:51:03 UTC, Andrei Alexandrescu
wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
If nothing else please watch the opening story, it's true and
quite funny :o).
Now as to the talk, as you could imagine, it touches on another
language as well...
Andrei
On 2019-01-14 15:42, Steven Schveighoffer wrote:
That's a bad example :) The clear answer is mysql-native, which is what
vibe.d recommends.
Exactly, and I don't need five minutes for that. Five seconds is enough :)
--
/Jacob Carlborg
On 2019-01-14 08:50, Walter Bright wrote:
Interesting cites, which provide a basis for why I've opposed AST
macros, and why Ddoc and unittest are builtin (and a few other things).
But Ddoc has macros ;)
--
/Jacob Carlborg
On Mon, Jan 14, 2019 at 03:57:36PM +, Adam D. Ruppe via
Digitalmars-d-announce wrote:
> On Monday, 14 January 2019 at 14:56:00 UTC, bachmeier wrote:
> > Only a small sliver of programming involves anything where "overhead
> > of a runtime" is an issue. I hope you intend this comment as
> >
On 1/14/19 10:57 AM, Adam D. Ruppe wrote:
On Monday, 14 January 2019 at 14:56:00 UTC, bachmeier wrote:
Only a small sliver of programming involves anything where "overhead
of a runtime" is an issue. I hope you intend this comment as
pertaining to Better C usage.
Real D is the true better C.
On Monday, 14 January 2019 at 14:56:00 UTC, bachmeier wrote:
Only a small sliver of programming involves anything where
"overhead of a runtime" is an issue. I hope you intend this
comment as pertaining to Better C usage.
Real D is the true better C. These improvements can improve in
various
On Monday, 14 January 2019 at 03:58:37 UTC, Mike Franklin wrote:
Because design by introspection allows us to "assemble programs
atomically", perhaps high-level language features like classes
and interfaces can become obsolete, and the language itself can
be reduced simpler primitives that
On Monday, 14 January 2019 at 10:06:48 UTC, Mike Franklin wrote:
On Monday, 14 January 2019 at 05:31:27 UTC, Paul Backus wrote:
When something like an object system is made part of the
language (or at the very least, the standard library), it
becomes a focal point [2] that the community can
On Monday, 14 January 2019 at 05:31:27 UTC, Paul Backus wrote:
Scheme is probably the language that takes this idea of a
minimal "core language" with powerful metaprogramming
facilities the furthest, and the result is a fragmented
ecosystem that makes writing portable, non-trivial programs
On 1/14/19 5:18 AM, Martin Tschierschke wrote:
On Monday, 14 January 2019 at 07:50:32 UTC, Walter Bright wrote:
On 1/13/2019 9:31 PM, Paul Backus wrote:
Scheme is probably the language that takes this idea of a minimal
"core language" with powerful metaprogramming facilities the
furthest, and
On Monday, 14 January 2019 at 13:07:35 UTC, aberba wrote:
Do people really use Rust in production beyond the safety die
hards (of course Mozilla and few uses here and there, mostly C
guys...lowlevel purists)? Its such a weird,complicated and
academic lang... doubt it'll ever be mainstream like
On Monday, 14 January 2019 at 10:06:48 UTC, Mike Franklin wrote:
On Monday, 14 January 2019 at 05:31:27 UTC, Paul Backus wrote:
When something like an object system is made part of the
language (or at the very least, the standard library), it
becomes a focal point [2] that the community can
On Monday, 14 January 2019 at 05:31:27 UTC, Paul Backus wrote:
[1] http://winestockwebdesign.com/Essays/Lisp_Curse.html
This part always feels familiar to me in D (just replace Lisp
with D and Haskell with say Rust):
Answer: The Lisp Curse kicks in. Every second or third serious
Lisp
On Monday, 14 January 2019 at 07:50:32 UTC, Walter Bright wrote:
On 1/13/2019 9:31 PM, Paul Backus wrote:
Scheme is probably the language that takes this idea of a
minimal "core language" with powerful metaprogramming
facilities the furthest, and the result is a fragmented
ecosystem that
On Monday, 14 January 2019 at 05:31:27 UTC, Paul Backus wrote:
When something like an object system is made part of the
language (or at the very least, the standard library), it
becomes a focal point [2] that the community can coordinate
around. Due to the diverse, distributed nature of any
On 1/13/2019 9:31 PM, Paul Backus wrote:
Scheme is probably the language that takes this idea of a minimal "core
language" with powerful metaprogramming facilities the furthest, and the result
is a fragmented ecosystem that makes writing portable, non-trivial programs
close to impossible. (See
On Monday, 14 January 2019 at 03:58:37 UTC, Mike Franklin wrote:
What I wonder is, with design by introspection and the right
mix of other language features (e.g. `alias`, `alias this`,
mixins, etc...), what traditional language features can be
removed from the compiler and delegated to
On Saturday, 12 January 2019 at 15:51:03 UTC, Andrei Alexandrescu
wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
I especially like how design by introspection was contrasted with
concepts and metaclasses, culminating in "We want to generate
more smart code, not more boilerplate. We want to
On 1/12/2019 7:51 AM, Andrei Alexandrescu wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
One major takeaway is that the bugs/line are the same regardless of the language
used. This means that languages that enable more expression in fewer lines of
code result in fewer bugs for the same
On Saturday, 12 January 2019 at 15:51:03 UTC, Andrei Alexandrescu
wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
If nothing else please watch the opening story, it's true and
quite funny :o).
Now as to the talk, as you could imagine, it touches on another
language as well...
Andrei
On 1/12/19 7:21 PM, Bastiaan Veelo wrote:
On Saturday, 12 January 2019 at 15:51:03 UTC, Andrei Alexandrescu wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
If nothing else please watch the opening story, it's true and quite
funny :o).
Now as to the talk, as you could imagine, it touches on
On Saturday, 12 January 2019 at 15:51:03 UTC, Andrei Alexandrescu
wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
If nothing else please watch the opening story, it's true and
quite funny :o).
Now as to the talk, as you could imagine, it touches on another
language as well...
Andrei
Top
On 1/12/2019 7:51 AM, Andrei Alexandrescu wrote:
https://youtube.com/watch?v=tcyb1lpEHm0
Wonderful talk! The questions asked at the end were great, too.
https://youtube.com/watch?v=tcyb1lpEHm0
If nothing else please watch the opening story, it's true and quite
funny :o).
Now as to the talk, as you could imagine, it touches on another language
as well...
Andrei
84 matches
Mail list logo