Re: A brainfuck parser works now with newCTFE

2017-07-29 Thread Stefan Koch via Digitalmars-d
On Sunday, 30 July 2017 at 01:20:52 UTC, H. S. Teoh wrote: On Sun, Jul 30, 2017 at 01:15:50AM +, Stefan Koch via Digitalmars-d wrote: Hi Guys, I just ran the first moderately complex ctfe function successfully through newCTFE! This is the code that works now : module bf_parser; [...]

Re: A brainfuck parser works now with newCTFE

2017-07-29 Thread Stefan Koch via Digitalmars-d
On Sunday, 30 July 2017 at 01:15:50 UTC, Stefan Koch wrote: [ ... ] Shortly after posting this I came up with a more effective variant of the parseBf which reduces the generate bytecode from around 650 instructions to around 430 instructions. const(RepeatedToken[]) parseBf(const string inpu

Re: How do you use D?

2017-07-29 Thread Zwargh via Digitalmars-d
On Friday, 28 July 2017 at 14:58:01 UTC, Ali wrote: While the Orgs using D page is very nice ... I hoping to hear more personal stories ... So How do you use D? In work, (key projects or smaller side projects) I am using D to develop a system for rational drug design. The main applicatio

Re: A brainfuck parser works now with newCTFE

2017-07-29 Thread H. S. Teoh via Digitalmars-d
On Sun, Jul 30, 2017 at 01:15:50AM +, Stefan Koch via Digitalmars-d wrote: > Hi Guys, > > I just ran the first moderately complex ctfe function successfully through > newCTFE! > > This is the code that works now : > > module bf_parser; [...] > pragma(msg, parseBf("[,]")[3].token); > > I

A brainfuck parser works now with newCTFE

2017-07-29 Thread Stefan Koch via Digitalmars-d
Hi Guys, I just ran the first moderately complex ctfe function successfully through newCTFE! This is the code that works now : module bf_parser; enum BFTokenEnum { IncPtr = '>', DecPtr = '<', IncVal = '+', DecVal = '-', OutputVal = '.', InputVal = ',', LoopBegin =

Re: How do you use D?

2017-07-29 Thread Danni Coy via Digitalmars-d
On Sat, Jul 29, 2017 at 12:58 AM, Ali via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > While the Orgs using D page is very nice ... I hoping to hear more > personal stories ... > > So > > How do you use D > In work, (key projects or smaller side projects) > As a replacement for Python fo

Re: Accessing memory after destroy

2017-07-29 Thread Jonathan M Davis via Digitalmars-d
On Saturday, July 29, 2017 20:44:30 Johan Engelen via Digitalmars-d wrote: > I'd like to check a bit of info I need for Address Sanitizer > checking. > > The spec says [1]: > Use the destroy function to finalize an object by calling its > destructor. The memory of the object is not immediately > de

Re: Accessing memory after destroy

2017-07-29 Thread Johan Engelen via Digitalmars-d
On Saturday, 29 July 2017 at 22:15:41 UTC, Moritz Maxeiner wrote: Since in your example the (stack) variable `foo` is still referring to the (heap) memory location of the destroyed object Ah yes of course, thanks! - Johan

Re: Accessing memory after destroy

2017-07-29 Thread Moritz Maxeiner via Digitalmars-d
On Saturday, 29 July 2017 at 20:44:30 UTC, Johan Engelen wrote: [...] ``` class Foo { int x; this() { x = 1; } } Foo foo = new Foo; destroy(foo); assert(foo.x == int.init); // object is still accessible ``` [...] 2. It is _valid_ to access the memory after calling destroy. Point 2 is wo

Re: How do you use D?

2017-07-29 Thread H. S. Teoh via Digitalmars-d
On Fri, Jul 28, 2017 at 02:58:01PM +, Ali via Digitalmars-d wrote: [...] > How do you use D? vim + dmd git HEAD :-) Well, sometimes also gdc/ldc2, but usually just dmd git HEAD because I'm a sucker for bleeding edge D. > In work, (key projects or smaller side projects) Unfortunately, peopl

Re: Accessing memory after destroy

2017-07-29 Thread Eugene Wissner via Digitalmars-d
On Saturday, 29 July 2017 at 20:44:30 UTC, Johan Engelen wrote: I'd like to check a bit of info I need for Address Sanitizer checking. The spec says [1]: Use the destroy function to finalize an object by calling its destructor. The memory of the object is not immediately deallocated, instead

Accessing memory after destroy

2017-07-29 Thread Johan Engelen via Digitalmars-d
I'd like to check a bit of info I need for Address Sanitizer checking. The spec says [1]: Use the destroy function to finalize an object by calling its destructor. The memory of the object is not immediately deallocated, instead the GC will collect the memory of the object at an undetermined

Re: How do you use D?

2017-07-29 Thread David Gileadi via Digitalmars-d
On 7/29/17 3:05 AM, Russel Winder via Digitalmars-d wrote: In 2004 maybe "D as better C++" was a good line. In 2017 "D is a general purpose programming language that allow faster development time than C++, Go, and Rust" is a far better line? This is what attracts me to D--it's easy to write, cl

D client for ROS

2017-07-29 Thread Johan Engelen via Digitalmars-d
Hi all, Are there any robot folks out here that are working with ROS and would be able to work on creating a D client library for it? ROS is used a lot at our university and in robot research in general, and most people use the C++ client (the main one, next to Python). In arguing for teach

Re: all OS functions should be "nothrow @trusted @nogc"

2017-07-29 Thread Kagamin via Digitalmars-d
There's a less questionable problem with it. Hint: FILE struct is transparent, look inside it, lots of interesting stuff there.

Re: An Issue I Wish To Raise Awareness On

2017-07-29 Thread Kagamin via Digitalmars-d
On Tuesday, 25 July 2017 at 19:22:11 UTC, Marco Leise wrote: Since I/O is thread-safe[1], it should ideally be `shared` the way you put it. Also it sounds like a bad decision. void f() { printf("hello "); printf("world\n"); } If you have shared stdout and this function runs in 2 thr

Re: D easily overlooked?

2017-07-29 Thread Bienleine via Digitalmars-d
On Wednesday, 26 July 2017 at 15:55:14 UTC, Wulfklaue wrote: On Wednesday, 26 July 2017 at 06:40:22 UTC, Bienlein wrote: D is the most feature rich language I know of. Maybe only Scala comes close, but Scala can be at times an unreadable mess as the designers of the language valued mixing funct

Re: How do you use D?

2017-07-29 Thread Russel Winder via Digitalmars-d
On Fri, 2017-07-28 at 19:50 +, Anton Fediushin via Digitalmars-d wrote: > […] > It is more about marketing. Maybe Go is not a perfect language, > maybe not even a good one, but it's sold so good because of a > good marketing In the end Go is about interns at Google not making errors in Goog

Re: How do you use D?

2017-07-29 Thread O/N/S (Ozan) via Digitalmars-d
On Saturday, 29 July 2017 at 04:21:43 UTC, Shannon wrote: On Friday, 28 July 2017 at 14:58:01 UTC, Ali wrote: How do you use D? At my leisure time, I use it to build real-time apps (fast, faster, fastest ;-) At work, we use it for web-based stuff like apps in the cloud foundry. The big cha

Re: [OT] Generative C++

2017-07-29 Thread Kagamin via Digitalmars-d
On Saturday, 29 July 2017 at 06:22:46 UTC, Nicholas Wilson wrote: There is no reason you can't reflect on DblRep and generate the bit fields, see Stevens recent talk. https://forum.dlang.org/thread/ojai9r$se7$1...@digitalmars.com That will be cleaner indeed, but DCD will still be unable to see

Re: [OT] Generative C++

2017-07-29 Thread Kagamin via Digitalmars-d
On Friday, 28 July 2017 at 19:20:31 UTC, 12345swordy wrote: Reading through the dlang documentation, I can't find a way to enforce a certain code standard using mixins _traits ctfe. Imo it's very beneficial to have coding standards enforce by compile time. Typical way to enforce patterns are

Re: [OT] Generative C++

2017-07-29 Thread Iain Buclaw via Digitalmars-d
On 28 July 2017 at 21:20, 12345swordy via Digitalmars-d wrote: > On Friday, 28 July 2017 at 18:24:02 UTC, H. S. Teoh wrote: >> >> On Fri, Jul 28, 2017 at 05:38:10PM +, Stefan Koch via Digitalmars-d >> wrote: >>> >>> [...] >> >> >> Not necessarily. Perhaps "IR" is the wrong term to use, as in