Re: Intellij: Support for TextMate Bundled

2019-07-25 Thread David Bennett via Digitalmars-d-announce
On Thursday, 25 July 2019 at 18:46:00 UTC, bachmeier wrote: Curious if there are a lot of D programmers using IntelliJ. It's $500 just for the first year. I've been using IntelliJ Idea Community for D development for years, mostly for the syntax highlighting, code completion and linting.

Re: [your code here] 99 bottles of beer

2018-10-15 Thread David Bennett via Digitalmars-d
--- ct_beer.d static foreach_reverse(beer; 1..100) { pragma(msg, beer, " bottles of beer on the wall, ", beer, " bottles of beer. Take one down, pass it around, ", beer-1, " bottles of beer on the wall."); } void main(){} ---

Re: Phobos begat madness

2018-06-26 Thread David Bennett via Digitalmars-d
On Monday, 25 June 2018 at 01:03:03 UTC, David Bennett wrote: On Friday, 22 June 2018 at 21:37:07 UTC, Walter Bright wrote: If someone wants to figure out how to build an uncomplicated, straightforward, efficient implementation of text() that we can be proud of, that would be a nice

Re: Disappointing performance from DMD/Phobos

2018-06-25 Thread David Bennett via Digitalmars-d
On Tuesday, 26 June 2018 at 02:10:17 UTC, Manu wrote: [snip] @property uint systemBits() const { return systemData[].map!(e => e.length).sum; } [snip] This property sum's 4 ints... that should be insanely fast. It should also be something like 5-8 lines of asm. Turns out, that call to

Re: Phobos begat madness

2018-06-24 Thread David Bennett via Digitalmars-d
On Friday, 22 June 2018 at 21:37:07 UTC, Walter Bright wrote: If someone wants to figure out how to build an uncomplicated, straightforward, efficient implementation of text() that we can be proud of, that would be a nice contribution. Here [0] is part of a benchmark for implementing

Re: Phobos begat madness

2018-06-24 Thread David Bennett via Digitalmars-d
On Saturday, 23 June 2018 at 20:17:01 UTC, Vladimir Panteleev wrote: On Friday, 22 June 2018 at 21:37:07 UTC, Walter Bright wrote: text begat textImpl begat to begat toImpl begat toStr begat formatValue begat formatValueImpl begat put begat doPut begat Appender.put begat

Re: Phobos begat madness

2018-06-24 Thread David Bennett via Digitalmars-d
On Friday, 22 June 2018 at 22:36:23 UTC, Adam D. Ruppe wrote: I can't for at last two weeks, I'm about to fly tomorrow... and I'm getting married in August too so my life is kinda hectic. Congrats!

Re: Class qualifier vs struct qualifier

2018-06-15 Thread David Bennett via Digitalmars-d-learn
On Wednesday, 13 June 2018 at 07:35:25 UTC, RazvanN wrote: Hello, I'm having a hard time understanding whether this inconsistency is a bug or intended behavior: immutable class Foo {} immutable struct Bar {} void main() { import std.stdio : writeln; Foo a; Bar b;

Re: Confusion/trying to understand CTFE keywords

2018-06-07 Thread David Bennett via Digitalmars-d-learn
On Thursday, 7 June 2018 at 04:58:40 UTC, Jonathan M Davis wrote: It would be trivial enough to create a wrapper template so that you can do something like immutable n = ctfe!(foo()); e.g. template ctfe(alias value) { enum ctfe = value; } Would this be equivalent to using static

Re: stride in slices

2018-06-05 Thread David Bennett via Digitalmars-d
On Tuesday, 5 June 2018 at 05:05:47 UTC, David Bennett wrote: On Tuesday, 5 June 2018 at 03:13:05 UTC, Meta wrote: 14 ms, 520 μs, and 4 hnsecs 13 ms, 87 μs, and 2 hnsecs 12 ms, 938 μs, and 8 hnsecs When using `dmd -inline -O -release` with an extra simd benchmark I get: for loop:21

Re: stride in slices

2018-06-04 Thread David Bennett via Digitalmars-d
On Tuesday, 5 June 2018 at 03:13:05 UTC, Meta wrote: 14 ms, 520 μs, and 4 hnsecs 13 ms, 87 μs, and 2 hnsecs 12 ms, 938 μs, and 8 hnsecs When using `dmd -inline -O -release` with an extra simd benchmark I get: for loop:21 ms, 291 μs, and 6 hnsecs stride/fill: 64 ms, 927 μs, and 9 hnsecs

Re: cycle dependencies

2018-05-31 Thread David Bennett via Digitalmars-d
On Thursday, 31 May 2018 at 15:15:44 UTC, Steven Schveighoffer wrote: On 5/31/18 2:14 AM, Simen Kjærås wrote: On Wednesday, 30 May 2018 at 20:57:32 UTC, DigitalDesigns wrote: Why is this a runtime issue? It is not as if the execution of static this are non-deterministic. The compiler and

Re: What are AST Macros?

2018-04-13 Thread David Bennett via Digitalmars-d
On Friday, 13 April 2018 at 11:54:12 UTC, David Bennett wrote: Also the other idea I had was to have mixin functions that only take compiletime args (they are UFCS-able though, unlike templates) and mixin themselves when called like: --- mixin add1Xtimes(alias int a, alias int t){ uint

Re: What are AST Macros?

2018-04-13 Thread David Bennett via Digitalmars-d
On Friday, 6 April 2018 at 20:33:10 UTC, Chris Katko wrote: Sorry if this is "re-opening" an old thread, but did anything come from this and DIP50? It seems like a really interesting concept and this thread was one of the first results for a Google search. Thanks. Thanks for reminding me

Re: Is sorted using SIMD instructions

2018-04-12 Thread David Bennett via Digitalmars-d
On Thursday, 12 April 2018 at 10:14:55 UTC, rikki cattermole wrote: Just checked, change int to float and it uses ucomiss (SIMD, ldc -O3). There may not be an instruction for int's. Yep logic is much easier with floats and is available on SSE. It's hard to do logic on ints until SSE4.1 as

Re: Migrating an existing more modern GC to D's gc.d

2018-04-12 Thread David Bennett via Digitalmars-d
On Wednesday, 11 April 2018 at 19:38:59 UTC, Dmitry Olshansky wrote: On Tuesday, 10 April 2018 at 07:22:14 UTC, David Bennett wrote: People cast from thread local to shared? ...okay thats no fun... :( I can understand the other way, thats why i was leaning on the conservative side and

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread David Bennett via Digitalmars-d
On Tuesday, 10 April 2018 at 08:10:32 UTC, Jonathan M Davis wrote: Yes. They expect it to work, and as the language is currently designed, it works perfectly well. In fact, it's even built into the language. e.g. int[] foo() pure { return [1, 2, 3, 4]; } void main()

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread David Bennett via Digitalmars-d
On Tuesday, 10 April 2018 at 06:47:53 UTC, Jonathan M Davis wrote: As it stands, it's impossible to have thread-local memory pools. It's quite legal to construct an object as shared or thread-local and cast it to the other. In fact, it's _highly_ likely that that's how any shared object of any

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread David Bennett via Digitalmars-d
On Tuesday, 10 April 2018 at 06:43:28 UTC, Dmitry Olshansky wrote: On Tuesday, 10 April 2018 at 06:10:10 UTC, David Bennett wrote: I was thinking about messing with the GC in my free time just yesterday... how hard would it be: [snip] Lost immutable and that thread-local is often casted to

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread David Bennett via Digitalmars-d
On Tuesday, 10 April 2018 at 06:10:10 UTC, David Bennett wrote: I was thinking about messing with the GC in my free time just yesterday... how hard would it be: [snip] The idea is it works like it does currently unless something is invisible to other threads, Or am i missing something

Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread David Bennett via Digitalmars-d
On Tuesday, 10 April 2018 at 05:26:28 UTC, Dmitry Olshansky wrote: On Monday, 9 April 2018 at 19:50:16 UTC, H. S. Teoh wrote: Last I remembered, you were working on a GC prototype for D? Still there, but my spare time is super limited lately, the other project preempted that for the moment.

Re: Manipulate slice or specific element of range and return range

2018-03-22 Thread David Bennett via Digitalmars-d-learn
On Thursday, 22 March 2018 at 04:49:39 UTC, Seb wrote: No need for regular expressions. D is powerful enough without them: ``` alias lowercased = (m, n) => m.take(n).asLowerCase.chain(m.drop(n)); ``` https://run.dlang.io/is/cSL0si And with the filter, so it passes the assert: ```

Re: How to check if string is available at compile time

2017-09-21 Thread David Bennett via Digitalmars-d-learn
On Thursday, 21 September 2017 at 13:52:25 UTC, Meta wrote: On Thursday, 21 September 2017 at 12:30:15 UTC, David Bennett wrote: On Thursday, 21 September 2017 at 11:42:36 UTC, David Bennett wrote: enum isCTstring(alias arg) = (!isAssignable!(typeof(arg)) || __traits(compiles, mixin(` "foo"

Re: How to check if string is available at compile time

2017-09-21 Thread David Bennett via Digitalmars-d-learn
On Thursday, 21 September 2017 at 11:42:36 UTC, David Bennett wrote: [snip] ``` string[] escapeCTFE(Args...)(){ static foreach (arg; Args){ static if(__traits(compiles, ###WHATDOIPUTHERE###)){ [snip] So far the best I've come up with is : ``` enum isCTstring(alias arg) =

How to check if string is available at compile time

2017-09-21 Thread David Bennett via Digitalmars-d-learn
Hi Guys, Is there an easy way to check if the value of string passed to a template is available at compile time? Here is a cut down example of that I'm doing: ``` string[] escapeCTFE(Args...)(){ static foreach (arg; Args){ static if(__traits(compiles, ###WHATDOIPUTHERE###)){

Re: Internal error mixing templates and CTFE

2017-09-17 Thread David Bennett via Digitalmars-d-learn
On Friday, 15 September 2017 at 15:48:10 UTC, Stefan Koch wrote: are you using ucent ? Not that I know of, the code above is the full code (not sure what's used internally for string literals). I was using dmd 2.076 from the apt repo but the error also happens in LDC 1.3[1]. Is there an

Re: Internal error mixing templates and CTFE

2017-09-15 Thread David Bennett via Digitalmars-d-learn
On Friday, 15 September 2017 at 07:12:36 UTC, Andrea Fontana wrote: Internal error is always a bug, so it should be reported! I have opened a issue: https://issues.dlang.org/show_bug.cgi?id=17828

Internal error mixing templates and CTFE

2017-09-15 Thread David Bennett via Digitalmars-d-learn
Hi Guys, I've been playing around with CTFE today to see how far I would push it but I'm having an issue appending to an array on a struct in CTFE from a template: ``` struct Content{ string[] parts; } void add_part_to_content(Content content, string s)(){ content.parts ~= "Part: