Re: GC memory fragmentation

2021-04-16 Thread sarn via Digitalmars-d-learn
On Tuesday, 13 April 2021 at 12:30:13 UTC, tchaloupka wrote: Some kind of GC memory dump and analyzer tool as mentioned `Diamond` would be of tremendous help to diagnose this.. I've used bpftrace to do some of that stuff: https://theartofmachinery.com/2019/04/26/bpftrace_d_gc.html

Djinn: a new templating language and code generator

2021-01-01 Thread sarn via Digitalmars-d-announce
I was using Jinja2 to generate some files and I wished I had D ranges. So I made a toy proof-of-concept of a D answer to Jinja2. Then a COVID-19 outbreak here triggered a lockdown, and I polished it up a bit more: https://theartofmachinery.com/2021/01/01/djinn.html Hope someone else finds

Re: My hobby game running on the web using Emscripten

2020-12-12 Thread sarn via Digitalmars-d-announce
On Friday, 11 December 2020 at 14:59:47 UTC, Ferhat Kurtulmuş wrote: I saw a post[1] about d running on the browser using emscripten a while ago. I decided to modify my SDL-OpenGL hobby game[2] to run with emscripten. It is still WIP. But, nice to see it running on the browser :-D

Re: sumtype 1.0.0

2020-11-24 Thread sarn via Digitalmars-d-announce
On Wednesday, 25 November 2020 at 00:20:54 UTC, Paul Backus wrote: The exact memory layout and ABI of SumType is deliberately left unspecified. It's an implementation detail that client code isn't supposed to rely on. If you want to pass a SumType's value to a C function, you will first have

Re: canFind all elements in a array.

2020-11-10 Thread sarn via Digitalmars-d-learn
On Tuesday, 10 November 2020 at 08:19:15 UTC, Vino wrote: foreach(i; data2[]) { if(data1[].canFind(i[0])) { writeln(i[1]); } } This is iterating over all the elements in data2 and outputting some of them, so the output will never be longer than data2. It looks like you want to

Re: Druntime without pthreads?

2020-10-20 Thread sarn via Digitalmars-d-learn
On Tuesday, 20 October 2020 at 16:58:12 UTC, Severin Teona wrote: Hi guys. I have a curiosity, regarding [1] - I had encountered some "undefined reference" errors when trying to link the druntime (compiled for an embedded architecture) without some implementation of the POSIX thread calls

Re: A security review of the D library Crypto

2020-07-02 Thread sarn via Digitalmars-d-announce
On Wednesday, 1 July 2020 at 11:54:54 UTC, Cym13 wrote: On Wednesday, 1 July 2020 at 10:59:13 UTC, Dukc wrote: It also illustrates what's the prolem with cryptography: it's like coding without ability to test. Who could even dream to get that right the first or even the second time? I think

Re: Blog post on calling C from Python via D

2020-02-26 Thread sarn via Digitalmars-d-announce
On Wednesday, 26 February 2020 at 17:23:51 UTC, Meta wrote: On Wednesday, 26 February 2020 at 17:11:18 UTC, bachmeier wrote: There needs to be a variant of "mansplaining" modified for Python users. Agreed, and there also needs to be a variant of prison, modified for people who post dumb

Re: FeedSpot Recognizes the GtkDcoding Blog

2020-02-07 Thread sarn via Digitalmars-d-announce
On Friday, 7 February 2020 at 19:51:52 UTC, Andre Pany wrote: On Friday, 7 February 2020 at 18:16:37 UTC, Les De Ridder wrote: I'm not sure why LGPL is an issue. Does GtkD not allow dynamic linking? I am not an expert at all in the topic of licensing. This is my understanding: Gtk has the

Re: wc in D: 712 Characters Without a Single Branch

2020-01-28 Thread sarn via Digitalmars-d-announce
On Tuesday, 28 January 2020 at 14:01:35 UTC, Mike Parker wrote: Robert Schadek was inspired by a post he saw on Hacker News a while back showing an implementation of wc in Haskell totaling 80 lines. I enjoyed the article overall, but I think this part lets it down a bit: Is the Haskell wc

Re: code.dlang.org downtime

2019-12-17 Thread sarn via Digitalmars-d-announce
On Tuesday, 17 December 2019 at 17:34:07 UTC, H. S. Teoh wrote: On Tue, Dec 17, 2019 at 01:34:16AM +, bachmeier via Digitalmars-d-announce wrote: [...] Oh, I don't doubt that. My point was that it makes the D language project look like a small-scale open source project relying on

Re: D for microservices: ldc, rdmd, dub now available on Alpine x86_64

2019-11-05 Thread sarn via Digitalmars-d-announce
On Tuesday, 5 November 2019 at 12:20:04 UTC, Jacob Carlborg wrote: On Tuesday, 5 November 2019 at 11:49:20 UTC, Daniel Kozak wrote: Generally no, because Apline use musl libc instead of glibc, so there are some issues with that The correct way is to use static linking and putting only the

Re: remake of remake of Konami's Knightmare

2019-09-28 Thread sarn via Digitalmars-d-announce
On Saturday, 28 September 2019 at 02:59:20 UTC, Murilo wrote: On Thursday, 23 November 2017 at 12:18:38 UTC, ketmar wrote: recently i worked on remake of DOS remake of Konami's Knightmare game[0]. the game is playable now, it has music from original MSX Knightmare, and sfx/gfx/levels from DOS

Re: Linking D Runtime

2019-09-03 Thread sarn via Digitalmars-d-learn
On Saturday, 24 August 2019 at 02:10:19 UTC, Jonathan Levi wrote: I would love a more portable solution though. This should work for now. How are you building the D code? It should be possible to build a library (with -lib and/or -shared) that statically includes the runtime and Phobos.

Re: Snake game

2019-07-24 Thread sarn via Digitalmars-d-announce
On Wednesday, 24 July 2019 at 07:47:03 UTC, Alireza SN wrote: Hi, I'm new to D. Thought it would be fun to write a simple snake game for start. I hope it's not irrelevant to post it here. https://github.com/TheWeirdDev/SnakeD I posted it to the dlang subreddit:

Re: What are some ways to get more strict type-checking?

2019-05-05 Thread sarn via Digitalmars-d-learn
On Monday, 6 May 2019 at 02:02:52 UTC, Devin wrote: Recently, I poorly refactored some code, which introduced an obvious bug. But to my astonishment, the broken code compiled without any warnings or notifications. A minimum example is shown below: alias ID = uint; ... alias doesn't

Re: How does buffering actually work?

2019-02-28 Thread sarn via Digitalmars-d-learn
On Thursday, 28 February 2019 at 21:17:23 UTC, Cleverson Casarin Uliana wrote: It works almost perfectly, except that it doesn't wait for my first Enter after printing "First name: value1". Rather, it prints both "First name: value1" and "First name: value2" together on the same line, then it

Re: Should D file end with newline?

2019-02-16 Thread sarn via Digitalmars-d-learn
On Friday, 15 February 2019 at 13:14:47 UTC, Patrick Schluter wrote: A lots of fgets() based tools on Unix systems fail to read the last line if it doesn't contain a line feed character at the end. Afaicr glibc implementation does not have that problem but a lot of other standard C libs do.

Re: Should D file end with newline?

2019-02-12 Thread sarn via Digitalmars-d-learn
On Tuesday, 12 February 2019 at 20:03:09 UTC, Jonathan M Davis wrote: So, I'd say that it's safe to say that dmd The whole thing just seems like a weird requirement that really shouldn't be there, Like I said in the first reply, FWIW, it's a POSIX requirement. Turns out most tools don't care

Re: Should D file end with newline?

2019-02-09 Thread sarn via Digitalmars-d-learn
On Saturday, 9 February 2019 at 21:19:27 UTC, Victor Porton wrote: ISO C++ specifies that the C++ file must end with a newline. Should D file end with newline, too? I'm sure you could mostly get away without one, but POSIX says that all text files should end with a newline. There are some

Re: Vibe.d on Raspberry Pi

2018-11-05 Thread sarn via Digitalmars-d-announce
On Monday, 5 November 2018 at 16:06:38 UTC, Pander wrote: As reported in https://forum.dlang.org/thread/rgmbwuwfihauvngqm...@forum.dlang.org I've written a brief tutorial for the Pi board. I'm pretty new to D and the community so any suggestion is really highly appreciated. Bye, Andrea

Re: Quick C bindings

2018-09-28 Thread sarn via Digitalmars-d
On Friday, 28 September 2018 at 16:39:14 UTC, Márcio Martins wrote: What are you guys using these days to generate bindings? Writing them by hand is easy if the library doesn't use the preprocessor much. I often do that for simple jobs. dpp supports preprocessor directives (because it

Re: Updating D beyond Unicode 2.0

2018-09-28 Thread sarn via Digitalmars-d
On Friday, 28 September 2018 at 11:37:10 UTC, Dukc wrote: It's easy to miss a part of a post sometimes. That's very true, and it's always good to give people the benefit of the doubt. But most people are able to post constructively here without * Abrasively and condescendingly declaring

Re: Updating D beyond Unicode 2.0

2018-09-27 Thread sarn via Digitalmars-d
On Thursday, 27 September 2018 at 16:34:37 UTC, aliak wrote: On Thursday, 27 September 2018 at 13:59:48 UTC, Shachar Shemesh wrote: On 27/09/18 16:38, aliak wrote: The point was that being able to use non-English in code is demonstrably both helpful and useful to people. Norwegian happens to

Re: Updating D beyond Unicode 2.0

2018-09-23 Thread sarn via Digitalmars-d
On Sunday, 23 September 2018 at 06:53:21 UTC, Shachar Shemesh wrote: On 23/09/18 04:29, sarn wrote: You can find a lot more Japanese D code on this blogging platform: https://qiita.com/tags/dlang Here's the most recent post to save you a click:

Re: Updating D beyond Unicode 2.0

2018-09-22 Thread sarn via Digitalmars-d
On Sunday, 23 September 2018 at 00:18:06 UTC, Adam D. Ruppe wrote: I have seen Japanese D code before on twitter, but cannot find it now (surely because the search engines also share this bias). You can find a lot more Japanese D code on this blogging platform: https://qiita.com/tags/dlang

Re: Updating D beyond Unicode 2.0

2018-09-22 Thread sarn via Digitalmars-d
On Saturday, 22 September 2018 at 12:37:09 UTC, Steven Schveighoffer wrote: But aren't some (many?) Chinese/Japanese characters representing whole words? -Steve Kind of hair-splitting, but it's more accurate to say that some Chinese/Japanese words can be written with one character. Like

Re: std.experimental.collections.rcstring and its integration in Phobos

2018-07-18 Thread sarn via Digitalmars-d
On Wednesday, 18 July 2018 at 12:03:02 UTC, Eugene Wissner wrote: Therefore it shouldn't compile at all, but rcstring("ä")[].split("|") or rcstring("ä").byCodePoint.split("|") +1 to requiring an explicit byCodeUnit or whatever. For every "obvious" way to interpret a string as a range, you

Re: D's Destructors are What Scott Meyers Warned Us About

2018-07-08 Thread sarn via Digitalmars-d
On Monday, 9 July 2018 at 01:19:28 UTC, Mike Franklin wrote: In the context of your blog post at https://theartofmachinery.com/2018/05/27/cpp_classes_in_betterc.html, I'm wondering if the changes in 2.081 help matters at all: I'm wondering if any of the changes in 2.081 improves the situation

Re: How can I point an array to existing data in memory while using Better C?

2018-07-08 Thread sarn via Digitalmars-d-learn
On Sunday, 8 July 2018 at 21:11:53 UTC, Stijn Herreman wrote: On Sunday, 8 July 2018 at 20:27:34 UTC, Stijn Herreman wrote: I should point out that I only have a vague idea of what I'm doing, I tried things until it compiled and worked (at first glance). If there are any docs that properly

Re: Compilation is taking a ton of memory

2018-06-28 Thread sarn via Digitalmars-d
On Thursday, 28 June 2018 at 16:24:07 UTC, H. S. Teoh wrote: I continue to use SCons for my D projects. For dub dependencies, I just create a fake empty dub project with declared dependencies and run that separately for refreshing dependencies, but the actual compiling and linking is handled

Re: Compilation is taking a ton of memory

2018-06-27 Thread sarn via Digitalmars-d
On Wednesday, 27 June 2018 at 16:00:37 UTC, Mario Silva wrote: Any tips on how to code in a way that minimizes both compilation times and memory consumption when compiling? Here are my tips. I'd love to hear more from others. * Try to reduce imports. E.g., say you use a lot of stuff from

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-30 Thread sarn via Digitalmars-d
On Monday, 28 May 2018 at 22:53:03 UTC, 12345swordy wrote: Interesting... You don't mind me asking your assistance on writing DIP on this? I have one set up already, and I needed help as 1.) This is my first time writing a DIP 2.) I don't know what main course of action to take regarding

Re: SecureD Futures (v2.0)

2018-05-28 Thread sarn via Digitalmars-d
On Monday, 28 May 2018 at 07:52:43 UTC, Adam Wilson wrote: I understand that. Sorry, not for nothing, but you obviously don't. For starters, if you were familiar with the key derivation tools available 24hrs ago, you wouldn't have come up with PBKDF2 on PBKDF2. I suggest slowing down a

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-28 Thread sarn via Digitalmars-d
On Monday, 28 May 2018 at 20:13:47 UTC, 12345swordy wrote: How is __vdtor is going to be called, via destroy or via directly? Code using destroy() can still use destroy(). Otherwise, __vdtor would be callable in the same way that __dtor and __xdtor are. The plan is to have a better, safer,

Re: SecureD Futures (v2.0)

2018-05-28 Thread sarn via Digitalmars-d
On Monday, 28 May 2018 at 06:22:02 UTC, Adam Wilson wrote: On 05/27/2018 08:52 PM, sarn wrote: On Monday, 28 May 2018 at 02:25:20 UTC, Adam Wilson wrote: I like it. But it does require more space. We need three salts and three lengths in the header. One for the PBKDF2 KDK, one for the MAC

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-27 Thread sarn via Digitalmars-d
On Sunday, 27 May 2018 at 22:27:52 UTC, sarn wrote: I've been thinking this through a bit, and here's what I've got so far: Here's a tweak that should be implementable without any language changes: Instead of trying to detect an empty destructor, we use a UDA on the class --- call it

Re: SecureD Futures (v2.0)

2018-05-27 Thread sarn via Digitalmars-d
On Monday, 28 May 2018 at 02:25:20 UTC, Adam Wilson wrote: I like it. But it does require more space. We need three salts and three lengths in the header. One for the PBKDF2 KDK, one for the MAC key, and one for the encryption key. HKDF-Expand doesn't need a salt. You just need one salt to

Re: using wkhtmltopdf with D

2018-05-27 Thread sarn via Digitalmars-d-learn
On Monday, 28 May 2018 at 01:28:10 UTC, Dr.No wrote: What's likely the reason of the crash? mismatch between D and C memory alignment? From an ABI point of view, the raw pointers won't care about the memory structure they point to. The function call is the only thing that depends on the

Re: SecureD Futures (v2.0)

2018-05-27 Thread sarn via Digitalmars-d
On Sunday, 27 May 2018 at 10:27:45 UTC, Adam Wilson wrote: struct cryptoHeader { ubyte hdrVersion; // The version of the header ubyte encAlg; // The encryption algorithm used ubyte hashAlg; // The hash algorithm used uint kdfIters; // The number of PBKDF2

Re: DIP 1012--Attributes--Preliminary Review Round 1

2018-05-27 Thread sarn via Digitalmars-d
On Sunday, 27 May 2018 at 13:44:40 UTC, Mike Franklin wrote: I don't know what's happening with this DIP, but I've recently encountered a real-world problem for which there is no palatable workaround that this DIP would likely solve:

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-27 Thread sarn via Digitalmars-d
On Sunday, 27 May 2018 at 09:55:56 UTC, Mike Franklin wrote: TypeInfo has become my nemesis. I've been trying to replace runtime hooks that depend on TypeInfo with templates that can get their information at compile-time, but I'm running into all sorts of problems. e.g. Did you know

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-27 Thread sarn via Digitalmars-d
On Sunday, 27 May 2018 at 21:11:42 UTC, 12345swordy wrote: On Sunday, 27 May 2018 at 18:55:41 UTC, Mike Franklin wrote: And see this talk for a demonstration of the benefits https://www.youtube.com/watch?v=endKC3fDxqs Mike Can you actually reply to me instead of saying "read/watch this"?

Re: Draft for DIP concerning destroy is up.

2018-05-25 Thread sarn via Digitalmars-d
Just had a thought: attributes are inferred for templates, so maybe the ProtoObject could have a templated empty destructor. I don't think this would work with the existing destructor implementation, but it least it could be possible.

Re: Draft for DIP concerning destroy is up.

2018-05-25 Thread sarn via Digitalmars-d
On Friday, 25 May 2018 at 21:01:16 UTC, Mike Franklin wrote: On Friday, 25 May 2018 at 20:08:23 UTC, 12345swordy wrote: https://github.com/dlang/DIPs/pull/120 Feedback would be very appreciated. I was under the impression that Andrei's ProtoObject was supposed to remedy that:

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-25 Thread sarn via Digitalmars-d
:18:46 UTC, Manu wrote: On 23 May 2018 at 15:47, sarn via Digitalmars-d <digitalmars-d@puremagic.com> wrote: On Wednesday, 23 May 2018 at 02:13:13 UTC, rikki cattermole wrote: I would consider the current state with classes a bug. So ticket please, it should not require a DIP to change (al

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-23 Thread sarn via Digitalmars-d
On Wednesday, 23 May 2018 at 15:43:31 UTC, Steven Schveighoffer wrote: Coincidentally, this JUST changed due to a different reason: https://github.com/dlang/druntime/pull/2178 Please file an enhancement request. I still think it could be better, so I added a further issue:

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-23 Thread sarn via Digitalmars-d
On Wednesday, 23 May 2018 at 13:12:57 UTC, Steven Schveighoffer wrote: On 5/22/18 9:59 PM, sarn wrote: * Some code uses __dtor as a way to manually run cleanup code on an object that will be used again.  Putting this cleanup code into a normal method will cause fewer headaches. Using __dtor

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-23 Thread sarn via Digitalmars-d
On Wednesday, 23 May 2018 at 02:13:13 UTC, rikki cattermole wrote: I would consider the current state with classes a bug. So ticket please, it should not require a DIP to change (although Walter may disagree). Unfortunately, the way __dtor and __xdtor work for classes can't be changed

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-23 Thread sarn via Digitalmars-d
On Wednesday, 23 May 2018 at 19:28:28 UTC, Paul Backus wrote: On Wednesday, 23 May 2018 at 01:59:50 UTC, sarn wrote: The one other usage of these low-level destructor facilities is checking if a type is a plain old data struct. This is an important special case for some code, but everyone

D's Destructors are What Scott Meyers Warned Us About

2018-05-22 Thread sarn via Digitalmars-d
(I'm referring to Scott's 2014 DConf talk: https://www.youtube.com/watch?v=KAWA1DuvCnQ) I was actually preparing a DIP about this when Manu posted to the forums about his own related problems with C++ interop. I traced a bug in some of my D code to my own misunderstanding of how D's

Re: Using D without libphobos

2018-04-28 Thread sarn via Digitalmars-d
On Saturday, 28 April 2018 at 10:36:03 UTC, A. Nicholi wrote: Right. So there isn’t anything in core.* that would be in libphobos, only D runtime? And std.* depends on both, that is correct? Just want to be sure there aren’t edge cases or exceptions, it would be a handy rule of thumb. That's

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-27 Thread sarn via Digitalmars-d
On Friday, 27 April 2018 at 04:06:52 UTC, Nick Sabalausky (Abscissa) wrote: One of the items on my bucket list is to write a "CS Theory for Programmers" book that actually fills in all this stuff, along with going easy on the math-theory syntax that you can't realistically expect programmers

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread sarn via Digitalmars-d
On Friday, 27 April 2018 at 00:03:34 UTC, H. S. Teoh wrote: Actually, Turing-complete *does* mean it can do anything... well, anything that can be done by a machine, that is. No, it means there's some *abstract mapping* between what a thing can do and what any Turing machine can do. That

Re: Using D without libphobos

2018-04-26 Thread sarn via Digitalmars-d
On Thursday, 26 April 2018 at 03:04:55 UTC, A. Nicholi wrote: I am not sure if this is possible though I think you've got the technical answer already (just don't link in phobos2) but I'll add my 2c that Phobosless programming isn't just possible but realistically doable. It's a shame to go

Re: Strange behavior using array of structures

2018-04-04 Thread sarn via Digitalmars-d-learn
On Wednesday, 4 April 2018 at 10:00:18 UTC, Orfeo wrote: foreach (l; log) { l.run; } Try making this "foreach (ref l; log) {". Structs are value types in D, so by default they're copied when you assign them to another variable (in this case l). That means run() is

Re: Invading^W The Sydney C++ Meetup

2018-04-03 Thread sarn via Digitalmars-d
On Tuesday, 3 April 2018 at 01:10:45 UTC, finalpatch wrote: I will be presenting the second talk there, so should be even easier to spot. The one about template metaprogramming? Nice, I'm looking forward to that one.

Re: Vtable for virtual functions in D

2018-04-03 Thread sarn via Digitalmars-d
On Tuesday, 3 April 2018 at 00:22:52 UTC, Mike Franklin wrote: I'm curious about this comment in the code: Unfortunately, "protected" doesn't work, so a lot of members end up being public. This seems to just be an oversight in the language, so maybe it will change in future versions of D.

Re: Invading^W The Sydney C++ Meetup

2018-04-02 Thread sarn via Digitalmars-d
On Monday, 2 April 2018 at 07:46:08 UTC, Nicholas Wilson wrote: We could possibly do what the europeans were considering with a quarterly meet up (btw what happened to that?). I'd be up for an occasional event like that. Maybe it's easier to start with an online event (Google Hangouts or

Invading^W The Sydney C++ Meetup

2018-04-02 Thread sarn via Digitalmars-d
This feels like a long shot, but I figure it's worth a try. I'll be at the Sydney C++ Meetup this Thursday (and other Thursdays, no promises). If anyone lurking here is in Sydney and wants to talk about D with someone, come say hi. (I'm the guy with long brown hair and should be easy to

Re: Vtable for virtual functions in D

2018-04-02 Thread sarn via Digitalmars-d
On Thursday, 8 March 2018 at 22:07:24 UTC, sarn wrote: On Thursday, 8 March 2018 at 04:37:08 UTC, Mike Franklin wrote: Nice! I was thinking about something almost exactly like this recently since 2.079.0 has features to further decouple the language from the runtime. It would be nice to read

Re: "Advent of D" article on Reddit

2018-03-08 Thread sarn via Digitalmars-d-announce
On Friday, 9 March 2018 at 05:34:31 UTC, bauss wrote: Lmao I love Reddit. The D hate has moved onto a new level. Instead of hating on D, it's now geared towards the amount of upvotes a D post on reddit gets. What an amusement. To be fair, some things get posted to /r/programming that

Re: Vtable for virtual functions in D

2018-03-08 Thread sarn via Digitalmars-d
On Thursday, 8 March 2018 at 22:56:27 UTC, Henrik wrote: why do I have to put the @nogc on the constructor and destructor separately? You can make things slightly better by putting @nogc in the struct itself: struct S { @nogc: void member1() { } void member2() { } } But,

Re: Vtable for virtual functions in D

2018-03-08 Thread sarn via Digitalmars-d
On Thursday, 8 March 2018 at 04:37:08 UTC, Mike Franklin wrote: Nice! I was thinking about something almost exactly like this recently since 2.079.0 has features to further decouple the language from the runtime. It would be nice to read a blog post about this technique. Mike I didn't

Re: Vtable for virtual functions in D

2018-03-07 Thread sarn via Digitalmars-d
On Wednesday, 7 March 2018 at 12:49:40 UTC, Guillaume Piolat wrote: If you know enough D maybe you can implement your own virtual functions on top of D structs. It seems no one has made it yet. When I wrote Xanthe a year ago, I rolled my own classes using alias this and explicit vtables:

Re: Vtable for virtual functions in D

2018-03-06 Thread sarn via Digitalmars-d
On Tuesday, 6 March 2018 at 21:20:22 UTC, Henrik wrote: Does anyone know if D is using the vtable implementation for virtual functions just like most C++ compilers? If yes, can someone explain the advantages of this strategy? A function pointer in C is regarded as expensive because of missing

Re: Implementing tail-const in D

2018-01-23 Thread sarn via Digitalmars-d
On Tuesday, 23 January 2018 at 09:36:03 UTC, Simen Kjærås wrote: Since tail-const (more correctly called head-mutable) was mentioned here lately (in the 'I closed a very old bug!'[1] thread), I've been racking my brain to figure out what needs doing to make a viable solution. Have you seen

Re: OT: Indexing reordering in the eBay Search Engine

2018-01-21 Thread sarn via Digitalmars-d
On Friday, 19 January 2018 at 23:55:00 UTC, Jon Degenhardt wrote: If anyone is interested in the type of work that goes on in my group at eBay, take a look at this blog post by one of my colleagues: https://www.ebayinc.com/stories/blogs/tech/making-e-commerce-search-faster/ It describes a

Re: Memory Dump in D

2018-01-07 Thread sarn via Digitalmars-d
On Sunday, 7 January 2018 at 15:40:36 UTC, H3XT3CH wrote: I need it for windows and linux but primary for windows On *nix this is traditionally called a "core dump". A quick search will get you lots of tutorials. Most distros today disable core dumps with ulimit. Run "help ulimit" and

Re: Alias Vs. Enum?

2018-01-07 Thread sarn via Digitalmars-d
On Sunday, 7 January 2018 at 18:30:17 UTC, Simen Kjærås wrote: Instead of doing that silly dance, alias should simply take values as well. Also, using "enum" for manifest constants makes sense for people familiar with C idiom, but often confuses people coming from different languages.

Re: TickDuration deprecation

2017-11-22 Thread sarn via Digitalmars-d
On Wednesday, 22 November 2017 at 22:17:05 UTC, Walter Bright wrote: On 11/22/2017 5:45 AM, Steven Schveighoffer wrote: 1. All OS calls with timing requirements use non-floating point to represent how long to sleep. After all a CPU uses discrete math, and the timing implementation is no

Re: Looking for a job in USA

2017-11-20 Thread sarn via Digitalmars-d
On Monday, 20 November 2017 at 09:41:16 UTC, codephantom wrote: On Monday, 20 November 2017 at 09:15:15 UTC, Adam Wilson wrote: On 11/17/17 17:31, Indigo wrote: What is your reasoning for coming to the US? You might want to rethink this as America is collapsing. This is news to me, and I

Re: ESR on post-C landscape

2017-11-16 Thread sarn via Digitalmars-d-learn
On Tuesday, 14 November 2017 at 09:43:07 UTC, Ola Fosheim Grøstad wrote: ESR got famous for his cathedral vs bazaar piece, which IMO was basically just a not very insightful allegory over waterfall vs evolutionary development models, but since many software developers don't know the basics of

Re: ESR on post-C landscape

2017-11-16 Thread sarn via Digitalmars-d-learn
On Thursday, 16 November 2017 at 11:52:45 UTC, Ola Fosheim Grostad wrote: On Thursday, 16 November 2017 at 11:24:09 UTC, codephantom I would never say OO itself is a failure. But the idea that is should be the 'primary focus of program design' .. I think that is a failure...and I think that

Re: Proposal: Support for objects in switch statements

2017-11-07 Thread sarn via Digitalmars-d
On Monday, 6 November 2017 at 10:10:29 UTC, Atila Neves wrote: Checking for types at runtime is a code smell in OOP. Sometimes necessary, especially if doing multiple dispatch, but never done gladly. There's already a way to dispatch on type: virtual functions. Atila More on that:

Re: London senior DevOps job and two London [D-ish] developer roles

2017-10-23 Thread sarn via Digitalmars-d-announce
On Monday, 23 October 2017 at 05:26:17 UTC, Adil wrote: That email server is blocked. Other way round: SORBS is blocking your GMail server. They do stupid stuff like that sometimes :/ It might work if you try again later.

Re: Proposal: Object/?? Destruction

2017-10-16 Thread sarn via Digitalmars-d
On Sunday, 15 October 2017 at 15:19:21 UTC, Q. Schroll wrote: On Saturday, 14 October 2017 at 23:20:26 UTC, sarn wrote: On Saturday, 14 October 2017 at 22:20:46 UTC, Q. Schroll wrote: Therefore, and because of brackets, you can distinguish f(1, 2) from f([1, 2]). But in f([1, 2]), it's

Re: Proposal: Object/?? Destruction

2017-10-14 Thread sarn via Digitalmars-d
On Saturday, 14 October 2017 at 22:20:46 UTC, Q. Schroll wrote: Therefore, and because of brackets, you can distinguish f(1, 2) from f([1, 2]). But in f([1, 2]), it's ambiguous (just by parsing) whether [1, 2] is a tuple literal or a dynamic array literal. You'd need to use a prefix or

Re: Multiline string literal improvements

2017-10-10 Thread sarn via Digitalmars-d
On Tuesday, 10 October 2017 at 21:38:41 UTC, captaindet wrote: string a = |q{ firstLine(); if (cond) { secondLine() }   }; you could write your own string processing function according to your needs

Re: Proposal: Object/?? Destruction

2017-10-05 Thread sarn via Digitalmars-d
On Thursday, 5 October 2017 at 15:23:26 UTC, Seb wrote: I think I can state the opinion of many D users here: I don't mind whether it will be curly braces or round parentheses - the important thing is that we will be able to use it in the foreseeable future :) All my +1s. Let's leave syntax

Re: D's SwitchStatement accepts statements with ridiculous semantics

2017-09-29 Thread sarn via Digitalmars-d
On Friday, 29 September 2017 at 09:56:17 UTC, Dukc wrote: On Friday, 29 September 2017 at 09:12:54 UTC, Don Clugston wrote: Guess what this prints My guess is it prints "1". By "guess" I mean it, I did not test! Anyway reminds me a lot of very badly used gotos. Yeah, it's a lot like

Re: Hong Kong dlang Meetup

2017-09-07 Thread sarn via Digitalmars-d-announce
On Monday, 4 September 2017 at 19:25:59 UTC, Jonathan M Davis wrote: We haven't decided when exactly to meet up yet Any updates?

Re: Hong Kong dlang Meetup

2017-09-05 Thread sarn via Digitalmars-d-announce
On Monday, 4 September 2017 at 19:25:59 UTC, Jonathan M Davis wrote: Several of us from the D community will be in Hong Kong on a business trip next week (me, John Colvin, Atila Neves, and Ilya Yaroshenko), and our client, Symmetry Investments[1], has offered to sponsor a dlang meetup. We

Re: D as a Better C

2017-08-23 Thread sarn via Digitalmars-d-announce
On Wednesday, 23 August 2017 at 17:44:31 UTC, Jonathan M Davis wrote: I confess that I tend to think of betterC as a waste of time. The overwhelming majority of programmers don't need betterC. At all. But today we live in a world where practically everything just builds on top of C, and we

Re: D as a Better C

2017-08-23 Thread sarn via Digitalmars-d-announce
On Wednesday, 23 August 2017 at 16:17:57 UTC, SrMordred wrote: No structs in -betterC ??? I haven't tried the latest iteration of betterC yet, but the longstanding problem is that the compiler generates TypeInfo instances for structs, and TypeInfos are classes, which inherit from Object,

Re: Need some vibe.d hosting advice

2017-08-12 Thread sarn via Digitalmars-d
On Friday, 11 August 2017 at 13:06:54 UTC, aberba wrote: How would you do it if you were using vibe.d? Depends on who wants it built. I do consulting, so let me answer that way. "I don't want to think about ops and scalability and availability at all!" Then you'll have to pay a premium

Re: std.math module

2017-08-06 Thread sarn via Digitalmars-d-learn
On Sunday, 6 August 2017 at 23:33:26 UTC, greatsam4sure wrote: import std.math; import std.stdio; cos(90*PI/180) = -2.7e-20 instead of zero. I will appreciate any help. thanks in advance. tan(90*PI/180) = -3.689e+19 instead of infinity. What is the best way to use this module That's just

Re: DIP 1012--Attributes--Preliminary Review Round 1

2017-07-27 Thread sarn via Digitalmars-d
On Thursday, 27 July 2017 at 14:44:23 UTC, Mike Parker wrote: DIP 1012 is titled "Attributes". https://github.com/dlang/DIPs/blob/master/DIPs/DIP1012.md Like others in this thread have said, it needs more rationale. The rationale only mentions one actual problem: attributes can't be undone

Re: proposed @noreturn attribute

2017-07-08 Thread sarn via Digitalmars-d
On Sunday, 9 July 2017 at 00:16:50 UTC, Walter Bright wrote: We have types that cannot be named (Voldemort types), types that have no type (void), I suppose that types that cannot exist will fill out the edge cases of the menagerie. I assume there is a standard jargon for this - does anyone

Re: Allocation trace

2017-06-26 Thread sarn via Digitalmars-d
On Saturday, 24 June 2017 at 22:15:47 UTC, Andrei Alexandrescu wrote: Hello, does anyone have traces of allocations from real applications? Looking for the sequence of calls to malloc, realloc, and free, e.g.: 0 malloc 128 1 malloc 8192 2 malloc 32 3 free 1 ... Thanks, Andrei On *nix

Re: BetterC and TypeInfo Question

2017-06-22 Thread sarn via Digitalmars-d-learn
Currently a lot of language features generate dependencies on TypeInfo, arguably more than needed, but this is changing. Some examples are in this DConf 2017 talk: https://www.youtube.com/watch?v=endKC3fDxqs Also, the way the language is designed right now, all modules are responsible for

Re: dmd -betterC

2017-06-20 Thread sarn via Digitalmars-d
On Tuesday, 20 June 2017 at 17:30:43 UTC, Kagamin wrote: You can write a linker wrapper that will do the analysis you want, remove unneeded sections, stub symbols etc, see basic technique at https://theartofmachinery.com/2016/12/18/d_without_runtime.html I keep meaning to write an update to

Re: Immovable types

2017-04-18 Thread sarn via Digitalmars-d
On Wednesday, 19 April 2017 at 02:53:18 UTC, Stanislav Blinov wrote: I'd very much like to hear your thoughts on this, good/bad, if it already was proposed, anything. If it's found feasible, I could start a DIP. Destroy, please. I don't have comments about the syntax, but I did want this

Re: Of the use of unpredictableSeed

2017-03-21 Thread sarn via Digitalmars-d
On Tuesday, 21 March 2017 at 10:27:27 UTC, Andrei Alexandrescu wrote: Thanks Yuxuan, sorry for missing this. Can we have this peer reviewed by 1-2 crypto experts? Thanks! -- Andrei By API, unpredictableSeed() only returns a 32b uint and will never meet crypto standards. Beware of anyone who

Re: TLS

2017-03-10 Thread sarn via Digitalmars-d-learn
On Friday, 10 March 2017 at 19:24:29 UTC, bauss wrote: Mark your variables with __gshared. I would say shred, but it has some restrictions to it, where __gshared is the equivalent to global variables in C. immutable variables are also not put in TLS.

Re: Spotted on twitter: Rust user enthusiastically blogs about moving to D

2017-03-08 Thread sarn via Digitalmars-d
PSA: please don't feed the trolls.

Re: Of the use of unpredictableSeed

2017-03-06 Thread sarn via Digitalmars-d
On Monday, 6 March 2017 at 10:12:09 UTC, Shachar Shemesh wrote: Excuse me if I'm asking a trivial question. Why not just seed it from /dev/urandom? (or equivalent on non-Linux platforms. I know at least Windows has an equivalent). Shachar One reason is that /dev/urandom isn't always

Re: Writing pattern matching macros in D.

2017-03-05 Thread sarn via Digitalmars-d-learn
On Monday, 6 March 2017 at 02:20:02 UTC, Deech wrote: Hi all, I've been reading up on D's metaprogramming features and was wondering if it was possible to use them to add pattern matching to the language as a macro. The template mixin feature seems to require putting the new syntax in

Re: How to get dub to work when I have dlang installed in custom directory?

2017-03-03 Thread sarn via Digitalmars-d-learn
On Friday, 3 March 2017 at 20:35:04 UTC, Jamal wrote: I have no idea what is is wrong and or how to fix it. Any help? It would be the alias. When you're running dmd from your shell, you're using an alias that includes a bunch of flags to make dmd work. When dub runs, it'll run the dmd

Re: [NOTABLE PR] First step from traditional to generic runtime

2017-03-02 Thread sarn via Digitalmars-d
On Thursday, 2 March 2017 at 19:32:23 UTC, Andrei Alexandrescu wrote: Worth a look: https://github.com/dlang/druntime/pull/1781. This moves comparison code away from tedious runtime-introspected routines to nice templates. -- Andrei Great news :)

  1   2   >