An interesting article. Most of the listed disadvantages of annotations
are obviated by D's approach.
https://blog.softwaremill.com/the-case-against-annotations-4b2fb170ed67
Walter Bright:
Much like how ROR and ROL is efficiently handled in compilers
by having the compiler recognize the equivalent expression, I
think the best way to handle these issues is by having the
compiler recognize the multi-precision expressions, and rewrite
it internally into the optimal
On 2/9/2014 7:38 AM, bearophile wrote:
This shows how a C-like language lacks some essential parts to use well the CPUs
(both x86 and to ARM) to implement range integrals or multi-word integrals
efficiently without using asm:
http://accu.org/index.php/journals/1849
Much like how ROR and ROL is
On 02/09/2014 07:25 PM, Meta wrote:
On Sunday, 9 February 2014 at 17:55:50 UTC, bearophile wrote:
Francesco Cattoglio:
Wow, they are totally coping! :P
What's interesting is not just that Java has type annotations, but the
details of this feature. That article show many details.
On Sunday, 9 February 2014 at 17:55:50 UTC, bearophile wrote:
Francesco Cattoglio:
Wow, they are totally coping! :P
What's interesting is not just that Java has type annotations,
but the details of this feature. That article show many details.
Bye,
bearophile
I don't think he
Francesco Cattoglio:
Wow, they are totally coping! :P
What's interesting is not just that Java has type annotations,
but the details of this feature. That article show many details.
Bye,
bearophile
Am 09.02.2014 16:38, schrieb bearophile:
Two unrelated things found recently on Reddit:
In Java 8 they have added type annotations:
http://www.mscharhag.com/2014/02/java-8-type-annotations.html
This shows how a C-like language lacks some essential parts to use well
the CPUs (both x86 and to
Am 09.02.2014 17:23, schrieb Francesco Cattoglio:
On Sunday, 9 February 2014 at 15:38:24 UTC, bearophile wrote:
Two unrelated things found recently on Reddit:
In Java 8 they have added type annotations:
http://www.mscharhag.com/2014/02/java-8-type-annotations.html
Wow, they are totally
On Sunday, 9 February 2014 at 16:23:50 UTC, Francesco Cattoglio
wrote:
Wow, they are totally coping! :P Jokes aside, now I wonder:
what language introduced type anotation first?
Probably some CASE tool 20-30 years ago or so.
On Sunday, 9 February 2014 at 15:38:24 UTC, bearophile wrote:
Two unrelated things found recently on Reddit:
In Java 8 they have added type annotations:
http://www.mscharhag.com/2014/02/java-8-type-annotations.html
Wow, they are totally coping! :P Jokes aside, now I wonder: what
language
Two unrelated things found recently on Reddit:
In Java 8 they have added type annotations:
http://www.mscharhag.com/2014/02/java-8-type-annotations.html
This shows how a C-like language lacks some essential parts to
use well the CPUs (both x86 and to ARM) to implement range
integrals or
On Tuesday, July 03, 2012 09:42:58 Don Clugston wrote:
> On 02/07/12 23:20, Walter Bright wrote:
> > On 7/2/2012 1:04 PM, bearophile wrote:
> >> Walter Bright:
> >>> Put "final" in front of y, and it will compile. Remember, this was
> >>> done for D1
> >>> that didn't have const.
> >>
> >> I see.
On 02/07/12 23:20, Walter Bright wrote:
On 7/2/2012 1:04 PM, bearophile wrote:
Walter Bright:
Put "final" in front of y, and it will compile. Remember, this was
done for D1
that didn't have const.
I see. So in D2 are we going to require that y to be immutable?
No. I don't agree there's a p
On 7/2/2012 1:04 PM, bearophile wrote:
Walter Bright:
Put "final" in front of y, and it will compile. Remember, this was done for D1
that didn't have const.
I see. So in D2 are we going to require that y to be immutable?
No. I don't agree there's a problem. Nor do I care to break existing D
Walter Bright:
Put "final" in front of y, and it will compile. Remember, this
was done for D1 that didn't have const.
I see. So in D2 are we going to require that y to be immutable?
Bye,
bearophile
On 7/2/2012 7:37 AM, bearophile wrote:
I have compiled this Java code:
class Main {
public static void main(String[] args) {
int x = 2;
int y = 2;
switch(x) {
case 1: break;
case y: break;
}
}
}
It gives:
Main.java:7: err
Don Clugston:
Do you have a reference for this Java behaviour? I did a quick
google, and everything I found indicates that case labels must
be constants.
Thank you for your answer, Don.
I have compiled this Java code:
class Main {
public static void main(String[] args) {
int x =
ns by mistake)?
Calling it a "risk" and "killing" is way, way overstating things.
This post is about two Scala annotations. If that's not a bug, is
something like
that first Scala annotation useful in D too?
I don't really see any problem requiring a solution.
On Sunday, 27 May 2012 at 14:04:48 UTC, Dmitry Olshansky wrote:
IMHO if you use annotations for *this* then your language is as
good as dead.
There are far better things to aim annotations at.
I couldn't say it better. @switch might have some utility in rare
cases in a language with pa
> Was this automatic translation
> > desire worth the troubles (like inner classes,
>
> Yes.
>
> > like the risk of killing switch optimizations by mistake)?
>
> Calling it a "risk" and "killing" is way, way overstating things.
>
> > This pos
" and "killing" is way, way overstating things.
This post is about two Scala annotations. If that's not a bug, is something like
that first Scala annotation useful in D too?
I don't really see any problem requiring a solution. If you're working on
optimiza
;D translator yet). Was
this automatic translation desire worth the troubles (like inner
classes, like the risk of killing switch optimizations by
mistake)?
This post is about two Scala annotations. If that's not a bug, is
something like that first Scala annotation useful in D too?
Bye,
bearophile
On 5/27/2012 6:13 AM, bearophile wrote:
Currently this D2 code compiles:
void main() {
int x = 2;
int y = 2;
switch(x) {
case 1: break;
case y: break;
default:
}
}
I think that accepting that "case y" is a compiler bug, because y is a run-time
valu
"bearophile" wrote in message
news:dkpmzrcoppslcjqvd...@forum.dlang.org...
>
> Currently this D2 code compiles:
>
> void main() {
> int x = 2;
> int y = 2;
> switch(x) {
> case 1: break;
> case y: break;
> default:
> }
> }
>
> I think that accepting that "c
Alex Rønne Petersen:
1) Any half-decent compiler *will* optimize this thanks to a
wide array of standard dataflow analyses.
'y' was meant to be a value unknown at compile-time.
I don't know from where people got this crazy idea that a
switch statement MUST compile to a jump table *no matter
On 27.05.2012 17:13, bearophile wrote:
I have found two Scala annotations.
1) The first one is @switch:
http://www.scala-lang.org/api/current/scala/annotation/switch.html
Currently this D2 code compiles:
void main() {
int x = 2;
int y = 2;
switch(x) {
case 1: break;
case y: break;
default
On 27-05-2012 15:13, bearophile wrote:
I have found two Scala annotations.
1) The first one is @switch:
http://www.scala-lang.org/api/current/scala/annotation/switch.html
Currently this D2 code compiles:
void main() {
int x = 2;
int y = 2;
switch(x) {
case 1: break;
case y: break;
default
I have found two Scala annotations.
1) The first one is @switch:
http://www.scala-lang.org/api/current/scala/annotation/switch.html
Currently this D2 code compiles:
void main() {
int x = 2;
int y = 2;
switch(x) {
case 1: break;
case y: break;
default
On 2012-03-10 00:23, Andrei Alexandrescu wrote:
P.S. Please don't overquote, you systematically do so. Thanks!
I'll try to think about that.
--
/Jacob Carlborg
On 3/9/12 4:24 PM, Steven Schveighoffer wrote:
On Fri, 09 Mar 2012 19:05:00 -0500, Ary Manzana
wrote:
What are you talking about?
Who are you talking to?
:)
Seriously, though, I think Andrej sometimes quotes *nothing* (no offense
for picking on you Andrej), and couple that with the newsgro
On 3/10/12, Steven Schveighoffer wrote:
> I hope you realize I didn't mean it in a bad/condescending way :)
No problemo! I don't take things too seriously around this place (or
the internets in general).
> But whose fault is it?
I'd say it's the technology's fault. A newsgroup seems to be the
e
On Fri, Mar 09, 2012 at 08:07:47PM -0500, Steven Schveighoffer wrote:
> On Fri, 09 Mar 2012 19:58:37 -0500, H. S. Teoh
> wrote:
>
> >On Fri, Mar 09, 2012 at 07:24:34PM -0500, Steven Schveighoffer wrote:
> >>Seriously, though, I think Andrej sometimes quotes *nothing* (no
> >>offense for picking o
On Fri, 09 Mar 2012 19:58:37 -0500, H. S. Teoh
wrote:
On Fri, Mar 09, 2012 at 07:24:34PM -0500, Steven Schveighoffer wrote:
Seriously, though, I think Andrej sometimes quotes *nothing* (no
offense for picking on you Andrej), and couple that with the
newsgroup's seemingly random decision to s
On Fri, 09 Mar 2012 19:53:29 -0500, Andrej Mitrovic
wrote:
On 3/10/12, Steven Schveighoffer wrote:
Seriously, though, I think Andrej sometimes quotes *nothing* (no offense
for picking on you Andrej), and couple that with the newsgroup's
seemingly
random decision to start a new thread, or
On Fri, Mar 09, 2012 at 07:24:34PM -0500, Steven Schveighoffer wrote:
> On Fri, 09 Mar 2012 19:05:00 -0500, Ary Manzana
> wrote:
>
> >What are you talking about?
>
> Who are you talking to?
>
> :)
>
> Seriously, though, I think Andrej sometimes quotes *nothing* (no
> offense for picking on you
On 3/10/12, Steven Schveighoffer wrote:
> Seriously, though, I think Andrej sometimes quotes *nothing* (no offense
> for picking on you Andrej), and couple that with the newsgroup's seemingly
> random decision to start a new thread, or put a reply at the same level, I
> sometimes have no idea what
On Fri, 09 Mar 2012 19:05:00 -0500, Ary Manzana
wrote:
What are you talking about?
Who are you talking to?
:)
Seriously, though, I think Andrej sometimes quotes *nothing* (no offense
for picking on you Andrej), and couple that with the newsgroup's seemingly
random decision to start a
What are you talking about?
On Fri, 09 Mar 2012 18:23:17 -0500, Andrei Alexandrescu
wrote:
On 3/9/12 8:30 AM, Jacob Carlborg wrote:
As may serialization library Orange already does:
http://dl.dropbox.com/u/18386187/orange_docs/orange.serialization.Serializable.html
Look for "NonSerialized".
Saw that after posting.
On 3/9/12 8:30 AM, Jacob Carlborg wrote:
As may serialization library Orange already does:
http://dl.dropbox.com/u/18386187/orange_docs/orange.serialization.Serializable.html
Look for "NonSerialized".
Saw that after posting. Cool!
Andrei
P.S. Please don't overquote, you systematically do so
On Friday, March 09, 2012 16:00:03 Manu wrote:
> Okay, so the consensus is, it doesn't currently exist, but there is no real
> resistance, and is tentatively planned?
> Sounds good to me.
I wouldn't really say that it's tentatively planned. I don't recall Walter
ever weighing in on it at all, and
a struct or a class you'll have the same problem,
> just at a bigger scale. And it gets worse if you want to annotate templated
> types and functions: how can the attribute apply to each instance?
>
> I'm not saying any of this is impossible using mixins, just that it
> bec
On 2012-03-09 16:15:30 +, Andrei Alexandrescu
said:
I think a good approach in D would be to define mixins that work in
conjunction with the feature involved, for example:
class A {
int thing;
mixin(DoNotSerialize!"thing");
...
}
or together:
class A {
mixin(DoNotSe
On 9 March 2012 18:15, Andrei Alexandrescu wrote:
> On 3/9/12 2:56 AM, Manu wrote:
>
>> Does D have a nice way to add annotations or custom attributes to
>> entities?
>>
>> In Java/C# for example, it is common to annotate things with useful
>> compile time in
On 2012-03-09 17:15, Andrei Alexandrescu wrote:
On 3/9/12 2:56 AM, Manu wrote:
Does D have a nice way to add annotations or custom attributes to
entities?
In Java/C# for example, it is common to annotate things with useful
compile time information. I'd like to be able to do that in
That's easy to implement and extremely ugly.
On Fri, Mar 9, 2012 at 8:15 PM, Andrei Alexandrescu
wrote:
> On 3/9/12 2:56 AM, Manu wrote:
>>
>> Does D have a nice way to add annotations or custom attributes to
>> entities?
>>
>> In Java/C# for example, it is
On 3/9/12 2:56 AM, Manu wrote:
Does D have a nice way to add annotations or custom attributes to entities?
In Java/C# for example, it is common to annotate things with useful
compile time information. I'd like to be able to do that in D on occasion.
For instance, I'm serialising s
On 9 March 2012 17:20, bearophile wrote:
> Manu:
>
>
> Okay, so the consensus is, it doesn't currently exist, but there is no
>> real
>> resistance, and is tentatively planned?
>> Sounds good to me.
>>
>
> As far as I know there are no concrete ideas yet for the semantics and
> precise usage of
Manu:
Okay, so the consensus is, it doesn't currently exist, but
there is no real
resistance, and is tentatively planned?
Sounds good to me.
As far as I know there are no concrete ideas yet for the
semantics and precise usage of this feature. And I think there
are different ideas regarding
Okay, so the consensus is, it doesn't currently exist, but there is no real
resistance, and is tentatively planned?
Sounds good to me.
On 9 March 2012 15:42, Dmitry Olshansky wrote:
> On 09.03.2012 14:56, Manu wrote:
>
>> Does D have a nice way to add annotations or cus
On 09.03.2012 14:56, Manu wrote:
Does D have a nice way to add annotations or custom attributes to entities?
There is a potential for them. At least technically everything with @ in
front of it was supposed to be an annotation (like @property). I think
it's just, sort of, reserved for f
On 2012-03-09 11:56, Manu wrote:
Does D have a nice way to add annotations or custom attributes to entities?
Unfortunately no.
In Java/C# for example, it is common to annotate things with useful
compile time information. I'd like to be able to do that in D on occasion.
For instance
On 09-03-2012 11:56, Manu wrote:
Does D have a nice way to add annotations or custom attributes to entities?
Unfortunately, no.
In Java/C# for example, it is common to annotate things with useful
compile time information. I'd like to be able to do that in D on occasion.
Yes. This
Does D have a nice way to add annotations or custom attributes to entities?
In Java/C# for example, it is common to annotate things with useful compile
time information. I'd like to be able to do that in D on occasion.
For instance, I'm serialising some struct/class using reflection to
I really like the idea of annotations to use in traits
(compile-time-pseudoreflection).
I have the following code:
http://code.google.com/p/pspemu/source/browse/trunk/src/pspemu/hle/kd/rtc/sceRtc.d
Each function has associated a NID. And I have to specify the NID outside,
repeating the name of
%u:
> An idea for a potential use of annotations:
In my mind the main purpose of user-defined annotations is to allow the user to
write small (scoped) extensions to the type system.
But Python-style annotations too are useful.
Bye,
bearophile
dea for a potential use of annotations:
How about being able to annotate _anything_ with a template?
What problem does this solve? Is it just syntax sugar? If so, is it
worth complicating the language even more for this convenience?
(1) It's beautiful!
(2) It documents the fact that you&
On 2011-08-01 09:00, KennyTM~ wrote:
On Aug 1, 11 13:42, %u wrote:
An idea for a potential use of annotations:
How about being able to annotate _anything_ with a template?
It would be the equivalent of Python's annotations: the template's
first parameter would be an alias to the t
On 2011-08-01 07:42, %u wrote:
An idea for a potential use of annotations:
How about being able to annotate _anything_ with a template?
It would be the equivalent of Python's annotations: the template's
first parameter would be an alias to the thing being annotated, and
its return v
On 1/08/11 6:42 AM, %u wrote:
An idea for a potential use of annotations:
How about being able to annotate _anything_ with a template?
What problem does this solve? Is it just syntax sugar? If so, is it
worth complicating the language even more for this convenience?
On Aug 1, 11 13:42, %u wrote:
An idea for a potential use of annotations:
How about being able to annotate _anything_ with a template?
It would be the equivalent of Python's annotations: the template's
first parameter would be an alias to the thing being annotated, and
its return v
An idea for a potential use of annotations:
How about being able to annotate _anything_ with a template?
It would be the equivalent of Python's annotations: the template's
first parameter would be an alias to the thing being annotated, and
its return value would be the code generate
wondering what it would take to move forward with
>> getting user defined annotations into the language, and whether it
>> would be feasible for D2. Would the next step be to make a full
>> proposal?
>
> For this to be useful that language would probably need better reflecti
On 2011-03-11 04:30, Andrew Wiley wrote:
This is a topic that seems to come up every so often (well, I bring it
up every so often, but I haven't really heard negative remarks about
it), and I was wondering what it would take to move forward with
getting user defined annotations into the lan
Andrew Wiley:
> Would the next step be to make a full proposal?
Creating a pre-D Enhancement Proposal (pre-DEP) is good.
Bye,
bearophile
This is a topic that seems to come up every so often (well, I bring it
up every so often, but I haven't really heard negative remarks about
it), and I was wondering what it would take to move forward with
getting user defined annotations into the language, and whether it
would be feasible f
Kagamin wrote:
Andrei Alexandrescu Wrote:
What prevents us from doing
more generic annotations with syntax like @property?
Walter. No one's been able to convince him they're useful.
Then someone better put forward a good argument.
.Net framework is one big good argument, her
Andrei Alexandrescu Wrote:
> >> What prevents us from doing
> >> more generic annotations with syntax like @property?
> >>
> >
> > Walter. No one's been able to convince him they're useful.
>
> Then someone better put forward a good argum
On the syntax for D, a few thoughts:
In Python, the decorator expression must evaluate to a function, which
is then called with the function being decorated. We could do something
similar in D.
Let's change the syntax to this for now:
@(expr) decl
Let's assume that expr must be a template. T
For reference, Python has a concept called decorators. Take this function:
> def trace(fn):
> def __wrap(*pargs,**kwargs):
> print 'IN %s' % fn.__name__
> r = fn(*pargs,**kwargs)
> print 'OUT %s' % fn.__name__
> return r
>
> return __wrap
And use it like
t;, enumToString (s));
> -
>
Ok, so apparently D2 phobos already has this in std.typecons (saw that in a
reply over at ".D.learn"), but the main point of my post still remains. That
point being, it looks terrible and annotations could make it (and anything
similar) look not-terrible.
I've previously voiced my desire for something similar to C#'s attributes
(annotations in Java, IIRC), but that kind of got sidetracked into a
discussion of command line parsers. I have another idea of a type of
scenario where something like this would be very nice, and it also ties
72 matches
Mail list logo