Re: C++ to D converter based on clang
On 1/06/2016 9:40 PM, Jacob Carlborg wrote: Yes I could. Like I could participate to VisualD/cpp2d or magicport2 projects. Anything that is not using a real front end is a lost cause. Haha that really depends on your goals.
Re: Battle-plan for CTFE
On 19/05/2016 3:50 AM, Stefan Koch wrote: I am currently designing an IR to feed into the CTFE Evaluator. I am aware that this could potentially make it harder to get things merged since DMD already has the glue-layer. It's always more difficult to justify merging more complexity. But if you can present a working and superior solution the specific implementation is less important. It is still important that it matches the existing style of the compiler, especially with respect to adding dependencies. Also be aware that even with agreement on the eventual goal, it is still very slow to get big changes approved. eg ddmd took more than twice as long as it should have. This is why I suggested looking for incremental improvements, so you can overlap getting earlier things merged and developing later parts. I would be on the lookout for things that can be justified on their own (untangling AssignExp :) ) and try to push those through first.
Re: Battle-plan for CTFE
On 18/05/2016 9:01 AM, Martin Nowak wrote: Yes, this https://github.com/dlang/dmd/blob/7d00095301c4780b41addcfeb50f4743a9a6c5d4/src/dinterpret.d#L3418 is really ugly and complex, but you won't get rid of this inherent complexity. The e2ir code for AssingExp looks almost the same https://github.com/dlang/dmd/blob/7d00095301c4780b41addcfeb50f4743a9a6c5d4/src/e2ir.c#L2466. IMO this is a different problem, that AssignExp is stupidly complex and needs to be split up. You might imagine that it's easier to work with syntax trees than to start from scratch but I'm certain that's not true. I'm pretty sure that the simplest approach is to use the simplest possible machine-independent bytecode that you can come up with. I had got to the point of starting that, but I just couldn't face doing it in C++. All I'm saying is that interpreting the AST to generate bytecode is going to be as complex as interpreting the AST directly, but then you still a bytecode interpreter and later might still want a JIT. The bytecode generator and bytecode interpreter can be debugged (and tested!) independently. So the total amount of code will increase but the components themselves will be better isolated and easier to work with. I don't think a possible future need for a JIT is a good reason to avoid an bytecode interpreter. A large part of the work of adding a new (JIT) backend is pinning down the semantics, and adding a bytecode interpreter will certainly help to do that. Using dedicated value types during interpretation instead of recycling the AST for that will also make the transitions clearer and get rid of some of the lifetime complexities in the current code. Meh, sure. But this feels just as difficult as switching to a simple bytecode, without all the benefits.
Re: Battle-plan for CTFE
On 16/05/2016 9:20 PM, Martin Nowak wrote: On Monday, 16 May 2016 at 10:01:47 UTC, Kagamin wrote: Wasn't it possible to enable GC for entire compiler? There can be hybrid approach: 1) first allocate from bump heap 2) when it reaches, say, 200MB, switch to GC. Well, I wouldn't use D's GC for that dedicated heap. Allocation of CTFE values are completely independent and call be freed once the evaluation is finished. Maybe you wouldn't, but you certainly could...
Re: Battle-plan for CTFE
On 15/05/2016 11:25 PM, Martin Nowak wrote: On 05/15/2016 02:17 PM, Daniel Murphy wrote: For simple types that's true. For more complicated reference types... Variable indexes are not enough, you also need heap memory, but slices and pointers (and references) can refer to values either on the heap or the stack, and you can have a slice of a member static array of a class on the stack, etc. Then there are closures... So we do need a GC or RC for arrays, structs, classes (anything heapish). Values for those could be allocated by a simple bump/region allocator or a dedicated allocator that support individual freeing (via RC or GC). In any case struct Pointer { int index; /* 2B positive values for stack, 2B negative for heap*/ } wouldn't be much more complicated than a raw pointer (and a bit simpler to garbage collect). The problem is, if index refers to a single variable on the stack, then it's insufficient to refer to a variable inside an aggregate on the stack. Then you need to start building constructs for member of struct in array of struct pointers and it gets fairly messy... It's all solvable, I'm not sure the simplicity would survive. Neither e2ir or s2ir are actually that complex. A lot of the mess there comes from the backend IR interface being rather difficult to work with. Think of a simple switch statement where you even need to introduce relocations (or keep a list of fixup addresses) b/c you don't know the jump addresses in advance. This is not exactly difficult to do. In a visitor you simply test the cases and execute the first case body. Not to mention that we can reuse existing solutions from the current interpreter (e.g. for gotos see https://github.com/dlang/dmd/blob/0757504342e48e272372b7ac52cda5a333b2a2bc/src/dinterpret.d#L1014 and https://github.com/dlang/dmd/blob/0757504342e48e272372b7ac52cda5a333b2a2bc/src/dinterpret.d#L1094). Flow control is really not where the complexity lies IMO. The weird ways in which different types of reference types can combine leads to either very complicated or very low level descriptions of memory.
Re: Battle-plan for CTFE
On 15/05/2016 9:57 PM, Martin Nowak wrote: On 05/15/2016 01:58 PM, Daniel Murphy wrote: The biggest advantage of bytecode is not the interpreter speed, it's that by lowering you can substitute VarExps etc with actual references to memory without modifying the AST. By working with something lower level than the AST, you should end up with something much less complex and with fewer special cases. Which is a bad assessment, you can stick variable indexes into VarDeclaration (we already do that) and thereby access them in O(1). Converting control flow and references into byte code is far from trivial, we're talking about another s2ir and e2ir here. -Martin We really should have discussed this last week!
Re: Battle-plan for CTFE
On 15/05/2016 9:57 PM, Martin Nowak wrote: On 05/15/2016 01:58 PM, Daniel Murphy wrote: The biggest advantage of bytecode is not the interpreter speed, it's that by lowering you can substitute VarExps etc with actual references to memory without modifying the AST. By working with something lower level than the AST, you should end up with something much less complex and with fewer special cases. Which is a bad assessment, you can stick variable indexes into VarDeclaration (we already do that) and thereby access them in O(1). Converting control flow and references into byte code is far from trivial, we're talking about another s2ir and e2ir here. -Martin For simple types that's true. For more complicated reference types... Variable indexes are not enough, you also need heap memory, but slices and pointers (and references) can refer to values either on the heap or the stack, and you can have a slice of a member static array of a class on the stack, etc. Then there are closures... Neither e2ir or s2ir are actually that complex. A lot of the mess there comes from the backend IR interface being rather difficult to work with. We can already save a big chunk of complexity by not having to translate the frontend types. E.g. implementing the logic in the interpreter to correctly unwind through destructors is unlikely to be simpler than lowering to an IR.
Re: Battle-plan for CTFE
On 15/05/2016 8:29 PM, Martin Nowak wrote: No need for a byte-code interpreter, it mostly just adds overhead and complexity over an AST interpreter. If you want to go really fast you need some sort of JIT anyhow, but a proper interpreter will be orders of mangnitude faster than the current implementation. The biggest advantage of bytecode is not the interpreter speed, it's that by lowering you can substitute VarExps etc with actual references to memory without modifying the AST. By working with something lower level than the AST, you should end up with something much less complex and with fewer special cases. The current goal is not a full JIT, just something that manages memory in a less insane way.
Re: unit-threaded v0.5.7 - advanced multi-threaded unit testing library
On 9/02/2016 12:23 AM, Atila Neves wrote: What's new: Built-in unittest blocks can now have a name with just a string UDA: @("test that does stuff") unittest {... } I feel obliged to point out that this is going to be a disaster as soon as any other library decides that means something else.
Re: Vision for the first semester of 2016
On 1/02/2016 8:46 AM, Iain Buclaw via Digitalmars-d-announce wrote: I know, I've been hitting bug after bug in 2.067, and the answer has always been to backport from 2.068. I already have backported druntime's object.d from 2.068 because 2.067's object module has drifted so far out of sync with it's hidden implementation, I couldn't build anything! So I might as well backport the rest of the druntime library. Nothing much has changed as it was a "bugfix" release. The process will be complete when you've backported the entirety of 2.068.
Re: Release D 2.069.0
On 9/11/2015 10:25 AM, Jack Stouffer wrote: Is there any reason why this isn't currently used in the front end? Lack of testing, focus on matching c-dmd performance, it used to be blocked and nobody realized it wasn't any more etc.
Re: Release D 2.069.0
On 8/11/2015 1:41 AM, Dmitry Olshansky wrote: IMHO enabling D's GC in the frontend is better way to fix leaking in the CTFE, but there are some issues with that (it segfaults if we enable GC). Actually I think it's fixed now, just disabled. It used to have problems with lib*/scan*, but those are in D now, and most of the allocations from the glue layer are being forwarded to the GC through rmem. If anyone wants to try it they just need to add -version=GC to the DMD build flags and insert this function in root/rmem.d's version(GC) block. extern (C) void* allocmemory(size_t m_size) { return GC.malloc(m_size); }
Re: D-Day for DMD is today!
On 8/09/2015 1:54 AM, "Luís Marques wrote: On Friday, 4 September 2015 at 12:38:41 UTC, Daniel Murphy wrote: It's not that phobos is bad, it's that we're following the same development pattern we had with C++. We're using a conservative subset of D features and libraries, and slowly expanding what's acceptable. For example, DMD now uses foreach and delegates in a few places, and I expect we'll see a lot of use of D strings in the near future. Is there any place where this is documented? For instance, what D constructs are currently allowed, whether/which phobos imports have started to be accepted, and so on? No.
Re: D-Day for DMD is today!
On 6/09/2015 5:11 AM, Jacob Carlborg wrote: I'm pretty sure the conversion tool already converted at least some loops to foreach loops. I took that code out some time before the switch because D's stricter implicit conversions were causing problems in some places. Even doing it by hand is error-prone since dmd makes use of the extra freedom you get from raw for loops.
Re: D-Day for DMD is today!
On 6/09/2015 2:47 AM, Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= wrote: But you are going to do high level refactoring too, right? Not just local conversions into foreachs and the like? Of course. Some of this was been started before the conversion.
Re: D-Day for DMD is today!
On 1/09/2015 11:57 PM, Rory McGuire via Digitalmars-d-announce wrote: Surely this is a code coverage issue then? Are there any unit tests in ddmd? There is an enormous test suite, but there are also plenty of parts with zero coverage.
Re: D-Day for DMD is today!
On 2/09/2015 11:23 PM, Rory McGuire via Digitalmars-d-announce wrote: Surely if the dog food is so bad no one should be eating? It's not that phobos is bad, it's that we're following the same development pattern we had with C++. We're using a conservative subset of D features and libraries, and slowly expanding what's acceptable. For example, DMD now uses foreach and delegates in a few places, and I expect we'll see a lot of use of D strings in the near future.
Re: D-Day for DMD is today!
"Jacob Carlborg" wrote in message news:mrsigg$1574$1...@digitalmars.com... I'm pretty sure we already have a tool that generates C/C++ headers for D modules. Adam started one, I don't think it got to the point where it would work for this, and I don't agree that the json output is a good way to do it.
Re: D-Day for DMD is today!
"Iain Buclaw via Digitalmars-d-announce" wrote in message news:mailman.647.1440844869.13986.digitalmars-d-annou...@puremagic.com... Just an idea to selectively @tag any classes or functions you want to export to C++, then let the conversion tool do the rest. This is as opposed to going back to some sort of magicport.json format maintained outside the normal sources. I'm just planning to implement this in dmd and have it dump out all extern(C++) declarations. (and structs and constants)
Re: D-Day for DMD is today!
"Iain Buclaw via Digitalmars-d-announce" wrote in message news:mailman.640.1440835567.13986.digitalmars-d-annou...@puremagic.com... > I'm planning to generate the C++ headers from the D source rather than > maintain them by hand. You could use UDAs for that! How?
Re: D-Day for DMD is today!
""Luís Marques " wrote in message news:fnhnundiapulkyqmi...@forum.dlang.org... Probably not all of them, though, no? For instance, utf.h is not needed by the GDC / LDC glue code, is it? We don't have a policy on this yet. It won't matter so much if we can auto-generate the headers.
Re: D-Day for DMD is today!
""Luís Marques " wrote in message news:ckyiqzpchfahzfjmm...@forum.dlang.org... What is the relation between the .h files that were left intact, and the backend, GDC, and LDC? When the backend is converted to D, will the DMD source drop the C++ header files, or will (some?) of those be left behind because GDC and LDC will always use some C++ interfaces in their glue code? The frontend header files will need to stay intact, and GDC/LDC will continue to use them. All the backend header files can be deleted once the backend has been converted. I'm planning to generate the C++ headers from the D source rather than maintain them by hand.
Re: D-Day for DMD is today!
"Iain Buclaw via Digitalmars-d-announce" wrote in message news:mailman.598.1440753894.13986.digitalmars-d-annou...@puremagic.com... Best to start using GDC in the CI development of DMD now though so we catch them when it happens! I've played the 'upgrade the autotester' game before, and I'm not in a hurry to go again. But yes I absolutely agree that should happen.
Re: D-Day for DMD is today!
"Johannes Pfau" wrote in message news:mrp3m1$184s$1...@digitalmars.com... Current GDC master can compile DDMD, although it uses the 2.066.1 frontend. Iain backported the relevant C++ mangle changes: https://github.com/D-Programming-Language/dmd/pull/4957 Yeah, I guess the more accurate statement is that DDMD relies on some fixes that are not in DMD 2.066. At some point we will probably start relying on bug fixes or features that aren't available before 2.067 in any compiler.
Re: D-Day for DMD is today!
"Bruno Medeiros" wrote in message news:mrn30f$26ff$2...@digitalmars.com... Cool stuff! Yeah! What's the plan going forward, for those not so much up to date with what's going on? Is the next major release of DMD gonna be D-DMD based then? Which compiler is going to be used to compile D-DMD? The next major release (2.069) will use the D-based frontend. We're planning to use GDC and/or LDC releases based on the 2.067 frontend to compile DMD on most platforms.
Re: D-Day for DMD is today!
"Mike" wrote in message news:hkyvytmqbstkelkum...@forum.dlang.org... There are still a number of .h files in the front end. What will happen with those? Do they need to be maintained? For now they must be maintained by hand, if there is any possibility of the glue layers or backends needing them. In the future we will hopefully auto-generate them.
Re: D-Day for DMD is today!
"Dicebot" wrote in message news:jdgpeyxvdltshldnf...@forum.dlang.org... Great! Daniel, does that mean that I can remove DDMD testing job from my CI? :) Yes, thanks!
Re: D-Day for DMD is today!
"Joakim" wrote in message news:sfhycfhmabpfxxuxn...@forum.dlang.org... Great work, thanks to Daniel and others who helped out, can't wait to use ddmd and see all the changes that come with it in the next couple releases. I can't wait to use foreach internally! No more manual for loops! Can we look forward to a complete ddmd, ie backend and everything ported to D too, anytime soon? I've started on the glue layer, and most of that should be done soon, but the backend brings a bunch of complications: - The code style is nothing like the frontend - It makes heavy use of the preprocessor - We don't have a good way of testing it, which makes refactoring risky My current plan is to create a nice text form of the backend's IR, then convert DMC's test suite to this format, with before and after snapshots. I can then feed these tests through DMD's backend (no need for a C++ frontend any more) to check for regressions, letting me start modernizing the code and converting it to D. This is going to take a while.
Re: D-Day for DMD is today!
"BBasile" wrote in message news:fmoabuqgvlztgmqyj...@forum.dlang.org... By the way, currently under win32 it's not possible to build DDMD unless the line --- #HOST_DC=dmd --- is uncommented. Because there is a bunch of commands using dmd compile and run (-run) in win32.mak. Is it a bug ? Maybe I miss out a step to bootstrap ? The missing step is to set HOST_DC in the environment. My current HOST_DC is c:\d\dmd2.067beta\windows\bin\dmd.exe -conf=c:\d\dmd2.067beta\windows\bin\sc.ini
Re: D-Day for DMD is today!
"BBasile" wrote in message news:rljvemqjfvnnqqnnc...@forum.dlang.org... Excellent. I guess it's also time to clean the wiki page that explained how to build under win32 with DMC. It's obsolete now. Nope! The glue layer and backend are still in C++, and still need to be built with DMC.
Re: Monday is last day for DConf 2015 registrations
"Steven Schveighoffer" wrote in message news:mjkncd$21e7$1...@digitalmars.com... BTW, I will stress again that I'm going to be at the hotel all day Tuesday (and without a car) if anyone is interested in hanging out :) I'll be there from Saturday night.
Re: Implementing cent/ucent...
"Kai Nacke" wrote in message news:kxcbizohnxdtimjwl...@forum.dlang.org... But: I am not going to extend the DMD backend! This has 2 consequences. First, we need to decide how to integrate the code. (Do we want to clutter the code with #if WANT_CENT as I currently do? Should we wait for DDMD?) Second, someone needs to work on the DMD backend if DMD should support cent/ucent, too. I'm happy to do the DMD backend, at least on x86_64. I don't want WANT_CENT anywhere in there, it would be better to enable it through a runtime flag in Target in a similar way to the simd types.
Re: Release Candidate D 2.067.0-rc1
"Szymon Gatner" wrote in message news:tthkrzwwobmdzbufe...@forum.dlang.org... sure I could bug individuals to make things work for me, then discover another problem rinse and repeat. thing is i dont want things to somehow work (possibly only until next release that will breake it) I want to know that this is something that is cared about and can be considered mature (and i am looking for the weakest definition of "mature" possible) The only way bugs will get fixed is if you file them. D/C++ interop is definitely _not_ mature, but it is cared about. eg This release will fix most of the issues with using variadic functions across the D/C++ boundary.
Re: Release Candidate D 2.067.0-rc1
"Szymon Gatner" wrote in message news:oofoormyfxkefokvk...@forum.dlang.org... i really try not to be whiny about it but it is sooo frustrating. d advertises itself as easy to integrate with c/c++ and maybe in theory it is but in practice it is not true at all. simplest example from Adam's book I followed crashed miserable so I can only assume that -nobody- is mixing c++ with d on Win. DDMD is mixing D and C++ on all the autotester platforms. It's not that simple, but it should be possible.
Re: Release Candidate D 2.067.0-rc1
"Rainer Schuetze" wrote in message news:mehkf1$21k2$1...@digitalmars.com... I think we should not do it for the dmd 2.067 release. It would be good to have it integrated into the test infrastructure before adding it to the release. I think that needs to be a hard requirement.
Re: dfmt 0.1.3 (codename: "yebblied")
"Brian Schott" wrote in message news:wctzwywddsrjzbygr...@forum.dlang.org... https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.3 dfmt is a source code formatter for D. v0.1.3 fixes 34 issues from v0.1.2. The codename is inspired by somebody who may or may not* have filed 45 Github issues, 20 of them in a single day. *totally did Thanks for fixing them so fast! I've never had a release named after me before. For anyone interested, I've been running dfmt against ddmd and comparing the diffs. Because ddmd is auto-generated it's also auto-formatted, so the differences mostly show a bug in either magicport or dfmt. This has been a big help in getting ddmd's source ready for (the hopefully imminent) merge into master.
Re: Digger 1.1
"Robert M. Münch" wrote in message news:mdi3sn$jh8$1...@digitalmars.com... make -fwin32.mak C=backend TK=tk ROOT=root HOST_DC= "OPT=-o" "DEBUG=" "LFLAGS=-L/delexe/la" dmd.exe run idgen Error: 'run' not found dmd has very recently been changed to required dmd already installed on the system. Until digger is updated to take this into account, you can probably get it to work by defining the environment variable HOST_DC to point to your installed dmd. The error message is because it's trying to run this: $(HOST_DC) -run idgen.d which expands to this -run idgen.d
Re: dfmt 0.1.0
"Jacob Carlborg" wrote in message news:md8vu6$hc1$1...@digitalmars.com... The DMD front end is not really designed to be used as a library for tooling. It isn't, but it's slowly getting better. eg You can now build the lexer as a library without pulling everything else in. It's quite possible that in a couple of years it will be in a state where it's reasonable to build tools on top of it.
Re: dfmt 0.1.0
"Brian Schott" wrote in message news:updwbngwrilngxhun...@forum.dlang.org... dfmt is a D source code formatting tool. https://github.com/Hackerpilot/dfmt/ https://github.com/Hackerpilot/dfmt/releases/tag/v0.1.0 Is this on code.dlang.org? I can't find it.
Re: 2015 H1 Vision
"Vladimir Panteleev" wrote in message news:viqwfixznbdbdwvha...@forum.dlang.org... I don't use Dub You really should! I put it off for months and months but I'm quite happy with it now.
Re: 2015 H1 Vision
"Joakim" wrote in message news:nphrawlkmiwksghfy...@forum.dlang.org... Nice work, D needed some direction like this. I thought one oversight was no mention of ddmd, which seems to have gone into limbo over the last year. According to Daniel, it's pretty much done but is just waiting on Brad to add some support in the auto-tester, for 9 months now: Brad has put the host compiler in place on windows now, so the only issue with that is the invalid config file sitting in the dmd dir, which will probably be fixed by updating the dmd install to master so I can use the new '-conf' switch. There is also a crash related to D's va_copy not working, which I've nearly solved.
Re: Interfacing D to existing C++ code
"Walter Bright" wrote in message news:maed4o$2da6$1...@digitalmars.com... > > So constructors and destructors are mangled 'a la D' instead of the C++ > way. Please post this to bugzilla. The problems with constructors go beyond mangling, so the current forced D mangling is intentional to prevent wrong-code bugs. An approach that currently works is porting the code to D, being careful to exactly match the layout and functionality. When done right, this allows templated types to be constructed with any type in either language and passed back and forth without problems. This is what I've done for dmd's Array in ddmd.
Re: DConf 2015 Call for Submissions is now open
"Jonathan M Davis via Digitalmars-d-announce" wrote in message news:mailman.4595.1421160931.9932.digitalmars-d-annou...@puremagic.com... On Tuesday, January 13, 2015 14:39:42 Iain Buclaw via Digitalmars-d-announce wrote: > Daniel prefers to talk through other peoples talks. :o) Or to work on the compiler during their talks. ;) - Jonathan M Davis I'd deny it but there's video evidence. I'm going to blame it on too much coffee.
Re: DConf 2015 Call for Submissions is now open
"Brad Anderson" wrote in message news:jcidebafygjtdsabn...@forum.dlang.org... Sounds like a good subject for Daniel Murphy to talk about. He spent a good hour explaining to me how a linker works in the Aloft bar after most people had retired (thanks for that, Daniel) and he certainly knows dmd extremely well. I am considering proposing a talk about ddmd, which would touch on some of the compiler internals. We'll see.
Re: DMD's lexer available on code.dlang.org
"Laeeth Isharc" wrote in message news:vtgirvyjsalkzjvlz...@forum.dlang.org... Thanks v much - this will be very helpful indeed. Let me know if you have any questions about it.
Re: DMD's lexer available on code.dlang.org
"Daniel Murphy" wrote in message news:m8bdul$1dke$1...@digitalmars.com... I've created a dub package for the D version of DMD's lexer, generated automatically from the C++ source. github: https://github.com/yebblies/ddmd dub: http://code.dlang.org/packages/ddmd I've pushed a new version which should fix the 64-bit build errors.
Re: DMD's lexer available on code.dlang.org
"Laeeth Isharc" wrote in message news:yzmwemaevaltcmkyw...@forum.dlang.org... on a related note, have you considered sharing your translation tool (c++ -> D)? I completely understand if you would rather not of course. The translation tool is available on github and is boost licensed. This pull request contains the latest version in src/magicport - https://github.com/D-Programming-Language/dmd/pull/3410 Please keep in mind that the tool makes a lot of assumptions about the C++ source that may not be valid for projects other than dmd. It's fairly easy to adapt to other projects, but it won't work on them out of the box.
Re: DMD's lexer available on code.dlang.org
"Kiith-Sa" wrote in message news:nffxogzwpmayydyom...@forum.dlang.org... (sorry if you get this question too often) How is DDMD as a whole going? Is it getting closer or are ongoing DMD changes slowing it down too much? It's been sitting still for 8 nearly months because of https://github.com/braddr/d-tester/issues/39 and https://github.com/braddr/d-tester/issues/40 I don't mind getting asked, I just wish the answer would change. Anyway, great to have the lexer on DUB, not going to use if for now because I expect there to be changes, but I guess it may eventually be useful for writing tools. Hopefully lots of changes.
Re: DMD's lexer available on code.dlang.org
"Rikki Cattermole" wrote in message news:m8be2m$1dlp$1...@digitalmars.com... I saw that. I'm really looking forward to getting my teeth into it and doing some good old refactoring. Although that will be a while because of the auto generated thing. There's plenty of refactoring to be done on the C++ side too.
DMD's lexer available on code.dlang.org
I've created a dub package for the D version of DMD's lexer, generated automatically from the C++ source. github: https://github.com/yebblies/ddmd dub: http://code.dlang.org/packages/ddmd There are a few annoying limitations, such that it uses dmd's error printing and allocation functions, and requires configuration through 'global'. Here is an example program that uses the lexer: == import std.stdio; import std.file; import ddmd.tokens; import ddmd.lexer; / void main() { Lexer.initLexer(); string data = "void blah() {} // stuff"; auto l = new Lexer("myfile", data.ptr, 0, data.length, 0, 0); l.nextToken(); do { printf("token: %s\n", l.token.toChars()); } while (l.nextToken() != TOKeof); } == Prints: token: void token: blah token: ( token: ) token: { token: }
Re: Gource visualisations of various D repositories
"Andrej Mitrovic via Digitalmars-d-announce" wrote in message news:mailman.3585.1419448250.9932.digitalmars-d-annou...@puremagic.com... The animations are super-fast, it makes it hard to see what's going on but it's still fun. I wonder what that sudden branch explosion was in DMD, maybe some code which was committed but just never used (the C++ unit-test library, perhaps?). Hmm.. :) Yeah, the thing that shows up on the right was cppunit. Then after a couple of years of no activity, bam it's gone!
Re: Request for Recursive Warnings as Message DUB Flag
""Nordlöw"" wrote in message news:iswbimvzcxegthnxg...@forum.dlang.org... Crap, I should of course have posted this on digitalmars.D. You should probably post it on dub's issue tracker or forums.
Re: D is for Data Science
"weaselcat" wrote in message news:rnlbybkfqokypxlgf...@forum.dlang.org... I see array.sort is planned for future deprecation, what does "future" fall under? Generally 'future deprecation' means at least 6 months after it gets turned into a warning. Often it's significantly longer, because nobody bothers to update it after six months have passed.
Re: core.stdcpp
"eles" wrote in message news:rixtiaiokrukvqjsf...@forum.dlang.org... But the request is simply to split the current druntime in a language-runtime and a phobos-runtime. The namespace and so on might even remain the same and the existing code would run unmodified. What is really important is that a clear separation exists between the two *inside* the implementation. The users of D are not concerned about that, the compiler designers are. Have, as now, the language-runtime + the phobos-runtime calles as druntime. Why does bother you a re-modularization of druntime? I disagree that it's important, or even useful. One such platform exists and is the embedded system, others are the linux kernel and the like, and even others are writing D compiler back-ends and, yes, druntimes (well, exactly the part that it is called phobos-runtime above). An embedded system that can support all of D but doesn't have a cruntime? I don't believe it. If it has a cruntime then providing bindings is a non-issue, and if it can't support all of D then supporting only a subset (and then being free to exclude core.stdc) is inevitable. If you make porting harder, then you can safely bet that those ports won't ever exist. But is this truly what we want? I think it's more likely that those ports won't exist because those platforms don't exist.
Re: core.stdcpp
"eles" wrote in message news:ybcxmuwwpsiyupwer...@forum.dlang.org... The question of dupplication may be addressed now better, since the newly fixed bug about hierarchical packaging. I don't see how. _only that_ should be the runtime. And the sole part that one needs to port in order to claim having a full port of the D language (that is, the compiler). These are the tires of the cars, the things that touch the ground. Everything else is optional. (Pirelli had a nice advertisemnt with this line) Well, I agree it absolutely has to be in druntime. And, to go further, only c/OS bindings required for this are to be embedded at this level. Requiring full c/OS bindings in druntime is so useful, and it costs us so little. Besides a warm fuzzy feeling, not requiring them seems to only benefit D implementations for theoretical platforms that probably don't exist. Phobos shall be 100% optional, otherwise you don't have a language, but a framework. This is the separation line: the runtime is a must for the language, the standard library is not. If in doubt wether one piece belongs, cut here. Call it what you want. Phobos is supposed to be 100% optional but it currently is not. We get to decide where the line goes, and with D it is almost always decided on usefulness, not correctness. Requiring c bindings is useful.
Re: core.stdcpp
"eles" wrote in message news:qrfucjdbmydvoqgey...@forum.dlang.org... While this might be acceptable, there is one more question: what use to have the druntime separated from phobos, in this case? Apart from the fact that it's too late to change of course. For me the druntime shall include only the runtime components that are required for a program to function and on which one could build the whole standard library. And that would be: handling the arguments, the GC, basically, the D program execution model. And by D here I mean "the language", not the "batteries included". Druntime and phobos both had c/OS bindings at some point (core.stdc + std.c) but duplication is bad, so they were/are being moved into druntime. In druntime you have the true, hidden runtime code (startup, profiler, coverage, unittesting, AAs), plus core language stuff (GC, Thread (+core.time)). Phobos is supposed to be 100% optional, although it isn't, quite. If you don't want to use phobos, for example if you are automatically porting a large C++ application, it's nice to simply ban phobos and have that clear distinction.
Re: core.stdcpp
"Mike" wrote in message news:bkkdiikafdsraqssj...@forum.dlang.org... > I really don't see a practical problem with having them in druntime, > only a philosophical one. It give the impression that D requires the C standard library, the C++ standard library, and an full-featured desktop OS in order to function. If I create a port without core.stdc, it can be argued that my port is incomplete. Well I argue that my port is a complete implementation of the language and core.stdc is not part of the D language. What platform supports threads and GC but doesn't have a C lib available? I certainly would argue that this hypothetical port is incomplete, not because druntime including bindings to libc declares it part of the language, but because I can't see a good reason not to include them. Then they can be put in their own library instead of phobos. Yes, they could. IMO the downsides of having to maintain a third library outweighs the 'correctness' advantage, or even having a different root package for this stuff. And there is no way it's ever going to change at this point. That's even better as far as I'm concerned. GTKD isn't part of phobos or druntime. I don't see libc as being any different (in principle) than GTKD. Druntime doesn't use GTK, so it is different. The inclusion of C/OS bindings is historical, and not worth changing. > and they are used in druntime internally. For a practical implementation, those ports that have a libc can make use of it, but it should be internal, and isolated from the language implementation and the other ports, as is the spirit of 11666. There is no point as the bindings are already in druntime and there is very little chance that is going to change. But you could take it a step further for the principled approach. Implement those few features of libc that are needed by the druntime in D, and earn some bragging rights. You could, but it has very little practical value. I personally wouldn't waste my time bragging to someone who thinks druntime depending on libc is an argument against D. Why create DDMD? We already have an implementation in C++, right. What a waste of time... (of course I'm being facetious. Forgive me, but I think it's a great example of why we should do something in D even though a C/C++ implementation exists. No offense intended) It's possible you missed the point of DDMD. DMD is an actively developed codebase which can benefit from many of the features D offers. Well, that was my motivation anyway. I know other people got excited by the idea for other reasons. There is no practical advantage (to the project) from converting a fully debugged, optimized application or library to another language, unless the language barrier is preventing interop. A libc written in D would not give us anything of practical value. That's exactly my point. The debate that ensued with 11666 had nothing to do with the spirit of 11666. If those OS bindings weren't in druntime, 11666 would already be implemented without controversy. And we'd likely already have a few more ports of D to other platforms. The 11666 debate belongs in a std.linux debate or a liblinux debate or some other OS API port debate. No, the exact same thing would have happened if they were in a different package/repository. A different root package would not change the contributors or contribution process. Publicly exposing core.stdc and the OS bindings in druntime is getting in the way of bringing D to more platforms, and the 11666 debate demonstrates that. This is just nonsense. Changing the root package changes nothing. Or those features in libc could be implemented in D, removing the artificial dependency on libc. Re-implementing debugged and optimized code is a waste of time. Only the *port* should have bindings to libc. The language implementation should not. Again those bindings should be encapsulated in the port, not publicly exposed as part of the D language. 1) Being part of druntime does not automatically mean something HAS to be available on every platform. eg the windows bindings are not available on non-windows 2) I don't see any point in not exposing the c lib from druntime, nor do I see any platform where that would be a problem that does not have much more serious issues with hosting D. * It conflates the language with the platform. druntime should be solely the implementation of the language, not an OS API. I disagree, having the OS API in druntime is great and not a problem. * It conflates the implementation of the language with bindings for external libraries. C interop is part of D. Low level (direct) access to operating system APIs is part of D. Exposing them is useful. Again, druntime is the language implementation, not an application programming framework. By this logic the C lib header files and windows.h files make an application programming framework. *
Re: core.stdcpp
"Ola Fosheim Grøstad" " wrote in message news:mclztlymyjydwhcxs...@forum.dlang.org... Probably, at least without whole-program optimization turned on. Linking with D is not a concern for whole-program-optimized C++ programs. But you still have to track compiler version changelogs and then deal with possibly multiple D implementations just fro one compiler. I guess it can work out if you limit yourselves to just std::vector and std::string… Yes, it's a pain. I've done it with one templated struct inside DDMD, and that was a pain. I don't know if it will work sufficiently for mapping to stl, but it's worth a try. It's usually easier to test with multiple versions and manually determine differences when problems arise. Changelogs often do not cover anything more than API changes, especially with some vendors. This idea would have a more merit if DMD was 100% LLVM based and focused on one architecture… Doing this for many compilers on many architectures sounds like versioning hell. It would be easier, but I don't think it changes the merit of the idea. Matching calling conventions is a much more difficult problem (in dmd's backend at least) and yet interoperability is so useful that it's worthwhile.
Re: core.stdcpp
"Mike" wrote in message news:zjscnxerhbxnopvay...@forum.dlang.org... The C standard library and C++ standard library are not part of D-the-language. D would even be better served by putting these features in phobos as std.stdc and std.stdcpp. This would make them just as conveniently available to users, and reduce the coupling between the language and the platform. I really don't see a practical problem with having them in druntime, only a philosophical one. They should still be available when not using phobos, and they are used in druntime internally. I think this is what makes issue 11666[1] so difficult and controversial. The features of the C std lib that are needed by the D runtime are not many, and could be re-implemented in D. The OS bindings needed to implement the D runtime could be internal and moved to a separate folder as proposed in the spirit of 11666. Public OS bindings could be put in std.linux, std.windows, etc... along with std.stdc and std.stdcpp. 11666 is contentious because everybody has a different opinion on the layout. This is about personal preferences, and has nothing to do with OS bindings being in druntime. The same exact discussion would happen if they were in phobos. It might be expeditious to just wrap and link, but I argue that D would be more appealing as a language (rather than a framework) if this wasn't the case. I get that you're saying this, but why? How will it make any difference to anything ever? libc is ubiquitous, and the parts that are used internally could trivially be reimplemented on a platform where it was missing. (or more likely, it could just be ported) I concede this is true for the vast majority of systems out there, but it makes D an applications programming framework, not a systems programming language. ??? If you want to / need to, you can write a libc implementation in D. The fact that the major D platforms all choose to link against the system libc instead of rolling their own has no bearing on the language class of D. The fact that druntime includes a prototype for memcpy or fopen does not change anything either. It just makes D more convenient for porting C code. I politely ask those pursuing core.stdcpp to reconsider and look further in the future. Please think beyond desktop and server application programming. Consider what D could be used for, not just what it is currently used for, and darken the line between the language and the platform. Make it a more of a language, and less of a framework. It could be my failing, but I really don't see the point. What are the potential consequences of maintaining and extending the C, C++ and OS bindings in druntime?
Re: core.stdcpp
"Ola Fosheim Grøstad" " wrote in message news:pbfaphgiugafrhach...@forum.dlang.org... I know, but the vendor provided C++ libraries could trigger compiler-magic in the optimizer, so it might not be enough to look at the source code in the general case… I would be very surprised to find a C++ compiler that does this over public function boundaries, as it would prevent mixing optimized and unoptimized code.
Re: D 2.066 is out. Enjoy!
"Mike" wrote in message news:sdrjfagsayomsngme...@forum.dlang.org... What's the motivation for embedding these things in the d runtime? Make them available. Wouldn't it be better to have a libc_d instead of core.stdc, libcpp_d instead of core.stdcpp, liblinux_d instead of core.sys.linux, etc...? I don't see how. I thought the D runtime was supposed to be simply an implementation of the language features, but it appears its scope is much more broad. Language features (gc, profiler, etc), OS bindings, C stdlib bindings. C++ bindings aren't a big leap from there. I think druntime started off including OS and stdlib bindings because it needed to use them internally, and it made more sense to expose them publically instead of adding dependencies or duplicating them. This makes the language coupled to those platforms and less general purpose like C and C++. I disagree. D does not depend on C++ being available, but druntime should provide bindings if possible. Depending on the C runtime is not a problem, because realistically you will either have a C runtime available for your platform, or be on a restricted platform where you will need to define your own D runtime, and can choose which parts of the C runtime to include.
Re: D 2.066 is out. Enjoy!
"Kagamin" wrote in message news:ujtkjzyvjhtvmcvjh...@forum.dlang.org... On Friday, 22 August 2014 at 08:18:18 UTC, Daniel Murphy wrote: > 2. These features are rather difficult to use, and I don't want people > to think they can just plug-and-play. I've spent a lot of time fighting > compiler alignment bugs, which are their own special kind of hell. Many > of those issues have been resolved now, but only in the areas that ddmd > actually exercises. Do you suggest that C++ interfaces should be written by the compiler team? I'm just saying you need a fairly good knowledge of the low-level workings on C++ and D, especially if something goes wrong. One example I hit, is that on windows if you had overloaded virtual functions, they would be inserted into the vtable backwards. These parts of the compiler are not very well tested, so if you're not comfortable debugging this sort of thing it might be better to wait until extern(C++) has seen heavier use.
Re: D 2.066 is out. Enjoy!
"Walter Bright" wrote in message news:lt7tan$24ei$1...@digitalmars.com... > 1. I hate writing documentation. I really really hate it. Join the club :-) =) Sorry you got to be the pioneer with the arrows in your back, but you've paved the way for the rest of us. I don't really mind, for some reason I enjoy tracking down wrong-code bugs. I just don't want everyone to think it'll be easy to plug in their favourite C++ library.
Re: D 2.066 is out. Enjoy!
"Walter Bright" wrote in message news:lt5l3k$2s5t$1...@digitalmars.com... The thing is, while the code was there, there wasn't a single test case for it in the test suite. Furthermore, at least for Elf, there was no support for the special mangling done for ::std:: stuff. Yeah, I don't know what happened to the test cases for template mangling. They were certainly tested when the new manger was being introduced, but somehow disappeared. There was no special std mangling because at the time C++ mangling was updated, there were no C++ namespaces in D. The thing is, modern C++ practice makes heavy use of std types. Having an interface to C++ code is fairly unusable unless D can also interface to std::string, std::vector, and a few others. The first step is to support the mangling of them. Then, try to construct a "workalike" on the D side that follows D rules, and yet is able to seamlessly interact with the corresponding C++ code. We'll see how far we can get with that, and then evaluate what to do next. It works for ddmd's array.d/array.h at least, although it's not very maintenance friendly. I assume you're aiming for something like a 'core.stdcpp.vector' with an implementation to match each stl implementation?
Re: D 2.066 is out. Enjoy!
"Jonathan M Davis" wrote in message news:fxdqpmfcbskvtcafz...@forum.dlang.org... LOL. Yeah, well, it would be ni going to support C+ce if we could get an actual list of the C++ features that D currently supports somewhere (and how to use them if it's not obvious). You've been doing so much great work on that that I have no clue what the current state of things is. For instance, this is the first I've heard of anything about template support; I'd thought that we were never going to support templates. Is it just for name mangling or for actually compiling them? Templates are sort-of supported. The main motivation was to allow dmd's Array type to be used in function signatures. This is nice, because it only requires correct name mangling, you don't need to worry about instantiation. Being able to call templated free functions and call methods on templated types will require each referenced template to be explicitly instantiated on the C++ side. I don't think it's realistic for D to do this automatically, although it is possible to do things like generate a non-templated forwarding wrapper function for each instantiation. In DDMD, this is worked around by array.d containing a functionally-equivalent translation of array.h. The D code all ends up calling the D version, and the two must be kept exactly in sync. This approach is probably feasible for accessing stl types and other common, rarely changing C++ templates. There are two reason it's not better documented: 1. I hate writing documentation. I really really hate it. 2. These features are rather difficult to use, and I don't want people to think they can just plug-and-play. I've spent a lot of time fighting compiler alignment bugs, which are their own special kind of hell. Many of those issues have been resolved now, but only in the areas that ddmd actually exercises.
Re: D 2.066 is out. Enjoy!
"Jacob Carlborg" wrote in message news:lt50m0$20f0$1...@digitalmars.com... > Support for C++ templates was in the last release, and the new pull > request is only for special mangling of some stl declarations. You see, I get confused of all the syntax changes ;) Don't worry, so did Walter.
Re: D 2.066 is out. Enjoy!
"Jacob Carlborg" wrote in message news:lt43pj$ral$1...@digitalmars.com... Support for C++ namespaces where just released and support for C++ templates will most likely end up in master soon. Support for C++ templates was in the last release, and the new pull request is only for special mangling of some stl declarations.
Re: DMD v2.066.0-b4
"safety0ff" wrote in message news:xfceasqsqxxygwzsc...@forum.dlang.org... I have a kludge / patch for #11435, but I get the impression of apathy towards back end issues so I don't feel motivated to contribute. Are you joking? Do a pull request.
Re: bugzilla and auto-tester temporarily down
"Brad Roberts via Digitalmars-d-announce" wrote in message news:mailman.3141.1404253839.2907.digitalmars-d-annou...@puremagic.com... The host that runs these two services is down. I'm working on getting them back up. There's a reasonable chance I'll end up having to restore both db's from last night's backups, meaning a loss of the last 18 hours of bugzilla changes other than the messages sent to the bugs newsgroup/forum/mailing-list. Hi Brad, have you been getting my emails?
Re: DMD 2.066 Alpha
"Andrei Alexandrescu" wrote in message news:lndq8q$obh$1...@digitalmars.com... > You did say that something with the same effect as 'virtual' was going > in. No. I am certain either you or Walter did in the last 'final by default' discussion. Please no new keyword for what can be done already. It's not proportional response. Are you serious? There absolutely is a need and we've been over this a thousand times.
Re: DMD 2.066 Alpha
"Andrei Alexandrescu" wrote in message news:lncrb0$31ec$1...@digitalmars.com... > It was decided and 100% certain - "virtual" is not going in. Need to > remove it from DMD before this release is out. Yes please. -- Andrei You did say that something with the same effect as 'virtual' was going in. It 1. allows escaping final, which we can't do without it or an equivalent 2. does exactly what everybody expects 3. is already implemented 4. looks much nicer than your proposal Why not just leave it in? I'm already using it, and it makes extern(C++) classes MUCH more readable (ie DDMD)
Re: auto tester moved
"Brad Roberts" wrote in message news:mailman.87.1397638127.2763.digitalmars-d-annou...@puremagic.com... The only thing I'm sure is broken right now are the old greasemonkey scripts to integrate test results with github (the native github build status stuff works still). I'll get those fixed up tomorrow.. they've been needing an overhaul for a long time. They appear to still be working. If you could add an auto-merge button so it shows up when I'm looking at a pull request that would be awesome.
Re: Bugzilla maintenance tonight
"Brad Roberts" wrote in message news:mailman.102.1397104256.1648.digitalmars-d-annou...@puremagic.com... At the bottom of the search results page there is a 'change columns' button with > the ui to control the columns to display. You'd have had to do this at some point on the old site too. I think I did the regression == orange manually in the templates and will re-do that change since I haven't found any configuration options to select the colors. It's one of the things on my todo list already since I noticed that too. :) Thanks!
Re: Bugzilla maintenance tonight
Is there some way to get the severity column back on the search results page? And make regressions orange again?
Re: Experimental win32 OMF linker written in D now on github
"Jay Norwood" wrote in message news:tsyxasgqmrkmuolmf...@forum.dlang.org... Is there a test suite that you have to pass to declare it fully functional? Not that I know of, but it _almost_ passes the dmd test suite (3 failures). I'm slowly refactoring it so I can build a comprehensive test suite.
Re: Experimental win32 OMF linker written in D now on github
"Daniel Murphy" wrote in message news:lgngea$1ccj$1...@digitalmars.com... So a couple of years ago I had too much free time and wrote a linker. It's now on github: https://github.com/yebblies/ylink Now updated with basic mscoff32 support - although dmd doesn't emit that file format, it does mean you can link the standard import libraries into your normal D applications, instead of having to convert them to omf. Hello world compiled with msvc works, but more complicated (C++) stuff most likely doesn't yet. (comdat aka templates might be buggy, and tls probably doesn't work)
Experimental win32 OMF linker written in D now on github
So a couple of years ago I had too much free time and wrote a linker. It's now on github: https://github.com/yebblies/ylink Pros: - Written in D - Not written in assembly - Not written before I was born - Boost license - Usually produces working executables Cons: - No debug information (yet) - Slower than optlink - Uses more memory than optlink (cannot run with < 64k of ram) - Cannot produce DLLs (yet) - Not really tested It still needs a lot of work, but it's functional. Potential uses: - Replace optlink - Replace microsoft linker (we could ship this with dmd) - Call from dmd to do in-memory linking - Experiment with linker optimizations Enjoy!
Re: Bountysource activity
"Andrei Alexandrescu" wrote in message news:53231aa4.1020...@erdani.org... That said, since recently there are too many D internal projects for me to oversee so if anything I'm lacking headcount. Awesome!
Re: D/Objective-C 64bit
"Jacob Carlborg" wrote in message news:lfqf4t$2v1o$1...@digitalmars.com... I think Daniel has said he as a working Linux compiler. He just need to create pull requests (and get them merged) for all changes his tool requires. The changes to dmd's source are all done(!), it's now time to start putting the manually ported stuff into the main repo.
Re: D/Objective-C 64bit
"Michel Fortin" wrote in message news:lfqcs6$2su5$1...@digitalmars.com... If the compiler is going to be converted to the D language (how is that progressing?), it'd probably be better to merge before that, otherwise it'll be a lot of work to port all those changes. The converter can convert git master, compile it with git master, and pass the full test suite + phobos on linux32/linux64/win32. If someone wants to give me access to an OSX box I'll get it working there too. The main problem with these patches is their use of #if in places where D's version blocks don't work. These will all need to be fixed before it is merged, as I've done for the rest of the frontend. I'm happy to help anyone set up the converter - contact me here/by email/on github. It should be as simple as 1. Build dmd master 2. git clone g...@github.com:yebblies/magicport2.git 3. Fix paths if you have a different layout than I do 4. make
Re: Facebook open sources flint, a C++ linter written in D
"Dicebot" wrote in message news:rkgevwccvxaynrbbi...@forum.dlang.org... Full stop. It should be other way around - remove all such arguable warnings from compiler to dedicated lint tool and never add any single one to compiler. Exactly. This sort of thing would make an excellent compiler plugin...
Re: Facebook open sources flint, a C++ linter written in D
"bearophile" wrote in message news:bskrlqgtwkqdyoqwk...@forum.dlang.org... D language has similar rules, but I don't rember if the D compiler warns against usage of similar identifiers. It doesn't! [snip etc] The D compiler is not a lint tool!
Re: dmd 2.065.0
"Steven Schveighoffer" wrote in message news:op.xbs1naiueav7ka@stevens-macbook-pro.local... A wild wild guess is that there was code in the compiler that used to require it (after all, it was required a long time ago), and somehow it got reactivated by accident. But wild guesses don't help fix bugs :) Walter + Andrei did it, and it was completely intentional, and it was known that it would break code. https://github.com/D-Programming-Language/dmd/pull/3054
Re: Dconf Hotel?
"Steven Schveighoffer" wrote in message news:op.xbm0zbffeav7ka@stevens-macbook-pro.local... I know that Andrei is now living in the area, and he was the one who picked Aloft. I'm assuming Andrei's house is likely not the new location ;) Where is the "hot spot" this year going to be? I want to book soon :) Afterparty and Andrei's house, every night.
Re: Bounty for -minimal compiler flag
"Denis Koroskin" wrote in message news:wjdvvungwvpemwmxl...@forum.dlang.org... I'll throw in $300 extra (maybe more), but can you please first formalize the requirements (list of flags, and what each flag should mean, required unittests to pass etc). Required unittests are very helpful, specifying switch names less so. I also think it's best to split into a few tasks (e.g. a task per feature or compiler flag). This way it is: - easier to verify correctness/completeness - many people can work without interfering with each other - easier to implement and grab a bounty Yes.
Re: Bounty for -minimal compiler flag
"Steven Schveighoffer" wrote in message news:op.xa929juueav7ka@stevens-macbook-pro.local... >> static this/~this is tougher. If it is possible for it to work, then >> it should. I feel that this is more of a language feature. > > These might work with init sections, but maybe not. No, static ctor/dtor is not a trivial mechanism. There is a runtime graph analysis to make sure there are no cycles, and then run them in the proper order. I think this feature has to be disabled. I meant that we could get something mostly working using init sections, but it's probably not a good idea. >> unittests are out as well. > > Most likely. Yes, this also depends on moduleinfo, like static ctor/dtor. Same with this, not worth the hack. > > I'll take it you've never seen how virtual functions are implemented in > C? Classes are awesome. This requires vtables and typeinfo. I've seen virtual functions implemented in C (back when I wrote Xt widgets). I also think that with D's compile-time power, one could probably recreate it using templates. I don't want to recreate it, I want to avoid it. The issue I have with allowing classes is the implications of classes. D classes are infinite-lifetime, meaning requiring GC. What we would end up with is classes written for the minimal no-gc version of D, and classes that were written to be allocated on the GC heap in full-D. And both would be named 'class' This is a very good point. extern(C++) classes do not depend on druntime, and currently do not have their destructors run by the GC!
Re: Bounty for -minimal compiler flag
"1100110" wrote in message news:ldl9fj$28g6$1...@digitalmars.com... > I don't think it's worth throwing out assert over. A runtime that > supported assert + Object would be about 8 lines and would IMO be > worthwhile. But then where do we stop? This is why I think it's an excellent idea to have multiple flags, or options, one for each thing disabled. So you can only disable what you do not want. 'assert' is pretty fundamental (compared to something like exceptions) and is especially important in low-level code. It can also be disabled using -release. I guess worst case the compiler could inline it as `e || _whatever_the_clib_calls_on_assert_failure` > > This puts us in the nasty situation of having code behave differently > with and without the switch. Like dynamic cast, I'd rather it was a > compile-time error and you had to use arr.ptr[0..newlen] instead. > Very Very good point there. I didn't think about that. Code should not behave any differently with different switches. Period. I seriously doubt it would make it into the repo either. Hmm, I forgot about new and delete. They would be nice to have as wrappers around malloc, but that would change the meaning of code...
Re: Bounty for -minimal compiler flag
"1100110" wrote in message news:ldl6v6$255r$1...@digitalmars.com... I dont know enough about TLS to comment really. Thoughts? It's probably platform dependent, I guess it should work everywhere that C supports TLS. Dynamic cast can be disabled. Sure, but should it be an error or be replaced with a static cast? static this/~this is tougher. If it is possible for it to work, then it should. I feel that this is more of a language feature. These might work with init sections, but maybe not. similarly, I'd expect scope(exit) to still work. With no exceptions, scope(xxx) will work just fine. Similarly, try-catch will be valid, just not throwing. profiling and code coverage are fine left out, since other tools can fill the same task. Yah. It would be nice if assert didn't depend on the runtime, but it's easy enough to implement. conditional, message and exit(); mmm... unittests are out as well. Most likely. All of those are optional features really. It would be nice to have them, but I feel that those pretty much require a runtime, and the whole point is to *not* require the runtime. I don't think it's worth throwing out assert over. A runtime that supported assert + Object would be about 8 lines and would IMO be worthwhile. ie small enough to copy+paste into your main.d > Also, D classes will fail to link without Object. I'm unsure how useful classes will be without a GC or the runtime... Thoughts? I'd be fine with then being disabled. I'll take it you've never seen how virtual functions are implemented in C? Classes are awesome. > > Should `array.length = x` be an error or just unsafely set the length? Unsafely set the length. Justification: There is no way to know whether or not you have manually adjusted the array or not. I see it as similar to pointer arithmetic in current D. Whether it works or not is dependent on the programmer. This puts us in the nasty situation of having code behave differently with and without the switch. Like dynamic cast, I'd rather it was a compile-time error and you had to use arr.ptr[0..newlen] instead.
Re: Bounty for -minimal compiler flag
"1100110" wrote in message news:ldl2pf$20b0$1...@digitalmars.com... I want a way to disable the GC, and have the compiler verify that no GC allocations may occur. I want a way to disable Exceptions, and have the compiler verify that no Exceptions may occur. Good, this is what I had in mind. I want a way to disable linking either the standard library and the runtime, and be able to run a minimal D program without needing to stub anything out manually. The idea can be boiled down to: > The idea is to be able to use a subset of D that does not require any of druntime or phobos - it can be linked merely with the C standard library. Cool. Can you name anything I'm missing? TLS, dynamic cast, profiling, static this/static ~this, assert, -cov, -profile, class == and synchronized all rely on druntime code. Also, D classes will fail to link without Object. Should `array.length = x` be an error or just unsafely set the length? Should it be ABI-compatible with normal D? If you don't have strong feelings about any of these they should still probably be listed.
Re: Bounty for -minimal compiler flag
"1100110" wrote in message news:ldkuku$1sgt$1...@digitalmars.com... I don't think we'll ever please everyone here. All I'm really trying to do by specifying the name is prevent some cutesy annoying name. It's pretty hard to get a pull request in with a silly switch name, so I wouldn't worry too much about that. I'd be fine with the switch being name -nodruntime, and honestly I like that better. Me too! >> Has to fulfill Walter's original post. (listed below) >> Has to split the separate parts into different flags as well as >> -minimal(-nogc, -nomoduleinfo, etc. Naming is left to the implementer). > > Make a enhancement report on bugzilla with the details. I will as soon as I iron a few wrinkles. I need to figure out if typeinfo should be a part of this as well. I strongly recommend putting only goals in the enhancement request, and avoiding implementation details (and especially syntax) whenever possible. Eg Struct equality requires typeinfo, but and implementation that changed it to use templates instead would probably be fine. The typeinfo part is irrelevant here, you just want to avoid having to link druntime in. Specifying individual flags is also not recommended, because a better interface might emerge and then the issue of whether the ER is completed gets messy. Instead saying "I want a way to disable just the GC" avoids this. Finally, putting many things in one request discourages partial fixes, makes discussion harder to follow, and could get complicated with a bounty involved. (what if two people implement different parts etc) It would be better (IMO) to split each atomic feature into its own ER and cross-link them, even if this means splitting the bounty across them.
Re: std.serialization
"Orvid King" wrote in message news:ntpjdeutsxqicjywt...@forum.dlang.org... (except for float->string conversion, which I don't understand the algorithms enough to implement myself) even going so far as to create an output range based version of to!string(int/uint/long/ulong/etc.). std.format.formatValue / std.format.formattedWrite ?
Re: Bounty for -minimal compiler flag
"1100110" wrote in message news:tjgimnoqoflzrcrlw...@forum.dlang.org... I'm offering a $50 bounty on this. (Preferably Bitcoins, but I'll use bountysource if desired.) I'd say just put it on bountysource, because then there's more chance others will add to it. rules: Has to be called -minimal Dealbreaker. The description for the switch reads "prevents all use of features which rely on druntime" and therefore the only reasonable switch name is "-nodruntime" or a variation of that. Has to fulfill Walter's original post. (listed below) Has to split the separate parts into different flags as well as -minimal(-nogc, -nomoduleinfo, etc. Naming is left to the implementer). Make a enhancement report on bugzilla with the details.
Re: dmd 2.065 beta 2
DDMD alpha win32 debug nogc http://dtsm460.web.cse.unsw.edu.au/dmd.2.065.0-b2.windows.ddmd.zip This one is most likely to work!
Re: dmd 2.065 beta 2
"Jacob Carlborg" wrote in message news:lc7vah$149c$2...@digitalmars.com... Cool. Is it too early to try it on OS X? It's ~4 hours work away from working on OS X (if the linux port is a good indicator), but I don't have a mac box to work on. If anyone can provide me with an ssh account I'd be happy to produce an OS X version.
Re: dmd 2.065 beta 2
On Sunday, 26 January 2014 at 23:38:56 UTC, Andrew Edwards wrote: We've made a lot of progress towards the 2.065 stable release. Available binaries are as follows: Linux http://ftp.digitalmars.com/dmd.2.065.0-b2.linux.zip For anyone feeling adventurous - I've uploaded an alternative version with the linux64 binary replaced by the linux64 ddmd binary. This is a debug build, with the GC disabled. http://dtsm460.web.cse.unsw.edu.au/dmd.2.065.ddmd.zip
Re: dmd 2.065 beta 1 #2
"Martin Nowak" wrote in message news:jcszzsgkwldowcmwz...@forum.dlang.org... Mmh, we could simply upload the intermediate zip files for each platform, that fall out of create_dmd_release before they are combined. Any ETA on this? I'd like to provide a win32 version with dmd replaced by ddmd for people to test.
Re: Dmitry Olshansky is now a github committer
"Walter Bright" wrote in message news:lbuc93$ke0$1...@digitalmars.com... (I also recommend registering yourname.com and a twitter account in your name, for the same reason.) Not so easy: https://github.com/DanielMurphy (not me) https://twitter.com/danielmurphy (not me) https://www.facebook.com/daniel.murphy (not me) http://en.wikipedia.org/wiki/Daniel_Murphy (none of these are me) http://danielmurphy.com.au (male stripper service) So instead, I have a unique handle I can use everywhere.
Re: dmd 2.065 beta 1 #2
"Martin Nowak" wrote in message news:jcszzsgkwldowcmwz...@forum.dlang.org... Mmh, we could simply upload the intermediate zip files for each platform, that fall out of create_dmd_release before they are combined. Sounds good.
Re: dmd 2.065 beta 1 #2
"Andrew Edwards" wrote in message news:lbmru9$290b$1...@digitalmars.com... ftp://ftp.digitalmars.com/dmd.2.065.b1.zip While you're at it, can we get per-platform zips? Just take the normal zip and delete all but one platform.
Re: dmd 2.065 beta 1
"Walter Bright" wrote in message news:lbelqh$e54$1...@digitalmars.com... It's a problem. There cannot be line endings in it. The one in the git repo has a unix line ending.