digitalmars.D - DMD versions
- Russel Winder (13/13) Feb 18 2011 What is the official way of programmatically determining the version
- Steven Schveighoffer (8/11) Feb 18 2011 AFAIK, there isn't a way. You can only determine D2 vs D1.
- Matthias Pleh (5/18) Feb 18 2011 There is the special Token __VERSION__ which gives an integer.
- Steven Schveighoffer (3/5) Feb 18 2011 That works ;) I looked on the "conditional compilation" page.
- Lars T. Kyllingstad (5/18) Feb 18 2011 Also, there's std.compiler, which "decodes" the information in
- Russel Winder (17/37) Feb 18 2011 Sadly (perhaps), when I said programmatically, I actually meant from
- =?UTF-8?B?IkrDqXLDtG1lIE0uIEJlcmdlciI=?= (12/39) Feb 20 2011 Note that the =E2=80=9Cright way=E2=80=9D (tm) to get the gcc (or gdc) ...
- Jens Mueller (8/36) Feb 18 2011 If you start dmd without any arguments it will give you the information
- Russel Winder (13/20) Feb 18 2011 OK, that is the same as "dmd --help", I can make it work. Thanks.
- Walter Bright (4/14) Feb 22 2011 Just for fun, try:
- Russel Winder (19/24) Feb 23 2011 That presupposes you are connected to the Internet. Much of the time I
- Christopher Bergqvist (22/42) Feb 23 2011 I've had an idea lately on that note. I'd think it would be cool if
What is the official way of programmatically determining the version number of the currently executing dmd? Thanks. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel russel.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Feb 18 2011
On Fri, 18 Feb 2011 07:36:18 -0500, Russel Winder <russel russel.org.uk> wrote:What is the official way of programmatically determining the version number of the currently executing dmd? Thanks.AFAIK, there isn't a way. You can only determine D2 vs D1. It would be a good feature to add to druntime though. Since druntime is inextricably linked with dmd, you could define an enum with the minor version. I remember Tango does this. -Steve
Feb 18 2011
Am 18.02.2011 13:51, schrieb Steven Schveighoffer:On Fri, 18 Feb 2011 07:36:18 -0500, Russel Winder <russel russel.org.uk> wrote:There is the special Token __VERSION__ which gives an integer. http://www.digitalmars.com/d/2.0/lex.html greets MatthiasWhat is the official way of programmatically determining the version number of the currently executing dmd? Thanks.AFAIK, there isn't a way. You can only determine D2 vs D1. It would be a good feature to add to druntime though. Since druntime is inextricably linked with dmd, you could define an enum with the minor version. I remember Tango does this. -Steve
Feb 18 2011
On Fri, 18 Feb 2011 07:56:46 -0500, Matthias Pleh <sufu alter.com> wrote:There is the special Token __VERSION__ which gives an integer. http://www.digitalmars.com/d/2.0/lex.htmlThat works ;) I looked on the "conditional compilation" page. -Steve
Feb 18 2011
On Fri, 18 Feb 2011 08:08:46 -0500, Steven Schveighoffer wrote:On Fri, 18 Feb 2011 07:56:46 -0500, Matthias Pleh <sufu alter.com> wrote:Also, there's std.compiler, which "decodes" the information in __VERSION__. http://www.digitalmars.com/d/2.0/phobos/std_compiler.html -LarsThere is the special Token __VERSION__ which gives an integer. http://www.digitalmars.com/d/2.0/lex.htmlThat works ;) I looked on the "conditional compilation" page. -Steve
Feb 18 2011
On Fri, 2011-02-18 at 13:20 +0000, Lars T. Kyllingstad wrote:On Fri, 18 Feb 2011 08:08:46 -0500, Steven Schveighoffer wrote: =20Sadly (perhaps), when I said programmatically, I actually meant from Python. So gcc has the -v option giving output that can be "parsed" to find the version number. javac has the -version option, as does groovyc. OCaml has a -version option. gdc has a -v option. I could go on. dmd seemingly has no option for delivering a version number. Which is sad. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel russel.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winderOn Fri, 18 Feb 2011 07:56:46 -0500, Matthias Pleh <sufu alter.com> wrote: =20 =20=20 Also, there's std.compiler, which "decodes" the information in=20 __VERSION__. =20 http://www.digitalmars.com/d/2.0/phobos/std_compiler.htmlThere is the special Token __VERSION__ which gives an integer. http://www.digitalmars.com/d/2.0/lex.htmlThat works ;) I looked on the "conditional compilation" page. =20 -Steve
Feb 18 2011
Russel Winder wrote:On Fri, 2011-02-18 at 13:20 +0000, Lars T. Kyllingstad wrote:On Fri, 18 Feb 2011 08:08:46 -0500, Steven Schveighoffer wrote:=20 Sadly (perhaps), when I said programmatically, I actually meant from Python. So gcc has the -v option giving output that can be "parsed" to=On Fri, 18 Feb 2011 07:56:46 -0500, Matthias Pleh <sufu alter.com> wrote:Also, there's std.compiler, which "decodes" the information in=20 __VERSION__. http://www.digitalmars.com/d/2.0/phobos/std_compiler.htmlThere is the special Token __VERSION__ which gives an integer. http://www.digitalmars.com/d/2.0/lex.htmlThat works ;) I looked on the "conditional compilation" page. -Stevefind the version number. javac has the -version option, as does groovyc. OCaml has a -version option. gdc has a -v option. I could go on. dmd seemingly has no option for delivering a version number. Whic=his sad. =20Note that the =E2=80=9Cright way=E2=80=9D (tm) to get the gcc (or gdc) v= ersion is to use the =E2=80=9C-dumpversion=E2=80=9D option, whose output contains o= nly the version. Jerome --=20 mailto:jeberger free.fr http://jeberger.free.fr Jabber: jeberger jabber.fr
Feb 20 2011
Russel Winder wrote:On Fri, 2011-02-18 at 13:20 +0000, Lars T. Kyllingstad wrote:If you start dmd without any arguments it will give you the information as well. $ dmd Digital Mars D Compiler v2.052 ... So you can parse the first line of this output. JensOn Fri, 18 Feb 2011 08:08:46 -0500, Steven Schveighoffer wrote:Sadly (perhaps), when I said programmatically, I actually meant from Python. So gcc has the -v option giving output that can be "parsed" to find the version number. javac has the -version option, as does groovyc. OCaml has a -version option. gdc has a -v option. I could go on. dmd seemingly has no option for delivering a version number. Which is sad.On Fri, 18 Feb 2011 07:56:46 -0500, Matthias Pleh <sufu alter.com> wrote:Also, there's std.compiler, which "decodes" the information in __VERSION__. http://www.digitalmars.com/d/2.0/phobos/std_compiler.htmlThere is the special Token __VERSION__ which gives an integer. http://www.digitalmars.com/d/2.0/lex.htmlThat works ;) I looked on the "conditional compilation" page. -Steve
Feb 18 2011
On Fri, 2011-02-18 at 14:47 +0100, Jens Mueller wrote: [ . . . ]If you start dmd without any arguments it will give you the information as well. $ dmd Digital Mars D Compiler v2.052 ... =20 So you can parse the first line of this output.OK, that is the same as "dmd --help", I can make it work. Thanks. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel russel.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Feb 18 2011
Russel Winder wrote:On Fri, 2011-02-18 at 14:47 +0100, Jens Mueller wrote:Just for fun, try: dmd -man !!If you start dmd without any arguments it will give you the information as well. $ dmd Digital Mars D Compiler v2.052 ... So you can parse the first line of this output.OK, that is the same as "dmd --help", I can make it work. Thanks.
Feb 22 2011
On Tue, 2011-02-22 at 22:29 -0800, Walter Bright wrote: [ . . . ]Just for fun, try: =20 dmd -man =20 !!That presupposes you are connected to the Internet. Much of the time I am not. I appreciate this is an almost heretical position to be in but mobile Internet hasn't actually arrived despite being sold. Interestingly, or not, Go allows for imports to refer to non-local Bazaar, Mercurial and Git repositories without local caching which means you can't compile code unless you are connected to the Internet. Don't let D go (!) this route. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel russel.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Feb 23 2011
I've had an idea lately on that note. I'd think it would be cool if rdmd (not standard dmd) had support for this style of import magic: // grab url:http://someserver.com/somelib/v1.0/src/somelib/somemodule.d size:4321 sha1:2fd4e1c67a2d28fced849ee1bb76e7391b93eb12 import somelib.somemodule; The hash & size of the file are there to make it very hard for someone to take over someserver.com and put malicious code there which people would download & run. rdmd could also have options for turning this feature off/on or into interactive mode where the user has to accept each download. Lets role some local cashing in there while we're at it also. :) Refraining from having a hash & size in there could be useful for unstable code but those imports should not be used without conscious input from the user. One could be allowed to view the code before typing "yes" and having the code put into the cache. On Wed, Feb 23, 2011 at 9:16 AM, Russel Winder <russel russel.org.uk> wrote= :On Tue, 2011-02-22 at 22:29 -0800, Walter Bright wrote: [ . . . ]=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3DJust for fun, try: =A0 =A0 dmd -man !!That presupposes you are connected to the Internet. =A0Much of the time I am not. =A0I appreciate this is an almost heretical position to be in but mobile Internet hasn't actually arrived despite being sold. Interestingly, or not, Go allows for imports to refer to non-local Bazaar, Mercurial and Git repositories without local caching which means you can't compile code unless you are connected to the Internet. =A0Don't let D go (!) this route. -- Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=Dr Russel Winder =A0 =A0 =A0t: +44 20 7585 2200 =A0 voip: sip:russel.wind=er ekiga.net41 Buckmaster Road =A0 =A0m: +44 7770 465 077 =A0 xmpp: russel russel.org=.ukLondon SW11 1EN, UK =A0 w: www.russel.org.uk =A0skype: russel_winder
Feb 23 2011