March 11, 2017
On Saturday, 11 March 2017 at 14:39:54 UTC, Stefan Koch wrote:
> Basic Slicing support is in;
> The following code will now compile with the newCTFE_slicing branch:

I guess this should greatly benefit compile-time parsing, right?
March 11, 2017
On Saturday, 11 March 2017 at 17:38:04 UTC, Nordlöw wrote:
> On Saturday, 11 March 2017 at 14:39:54 UTC, Stefan Koch wrote:
>> Basic Slicing support is in;
>> The following code will now compile with the newCTFE_slicing branch:
>
> I guess this should greatly benefit compile-time parsing, right?

As soon as the UTF8 stuff works properly, yes.
Slicing is really just syntactic sugar :)
March 11, 2017
On Sat, Mar 11, 2017 at 02:39:54PM +0000, Stefan Koch via Digitalmars-d wrote: [...]
> Contrary to the old interpreter no copies are made.
> newCTFE slices reference memory just as runtime slices do.
[...]

Awesome!  This alone ought to greatly expand the scope of what's feasible in CTFE.  Now I really can't wait to see this merged into master. :-)


T

-- 
English has the lovely word "defenestrate", meaning "to execute by throwing someone out a window", or more recently "to remove Windows from a computer and replace it with something useful". :-) -- John Cowan
March 12, 2017
On Saturday, 11 March 2017 at 14:39:54 UTC, Stefan Koch wrote:
> [ ... Slice Support ... ]

Hi Guys,
Since Slice support required an ABI there were a few bugs.
Interestingly those bugs where there for a very long time :)
The Type-handling I chose uses  an index into a specific type-array to represent types.
When this index is 0 we consider the type invalid.
However I had an off by one bug in the check, causing the first TypeInstance of static arrays to be considered invalid.
As an Invalid type the array has the size 0.
Which in turn causes the Allocation for that array to allocate zero bytes for it.
This zero allocation returns a valid pointer to the current top of the heap.
(just without reserving any memory).
Then when we slice the array the slice-descriptor has to go onto the heap.
And it overwrites the array-descriptor which was allocated with zero size.
causing it to point a to a bogus address which is equivalent to the array length.

My Sunday was ruined before it began :)
March 13, 2017
On Friday, 10 March 2017 at 11:32:14 UTC, Stefan Koch wrote:
> I am currently working on integrating 64bit values into codegen API.

How can dmd generate 64-bit code if backend doesn't support 64bit values?
March 13, 2017
On Monday, 13 March 2017 at 11:53:59 UTC, Kagamin wrote:
> On Friday, 10 March 2017 at 11:32:14 UTC, Stefan Koch wrote:
>> I am currently working on integrating 64bit values into codegen API.
>
> How can dmd generate 64-bit code if backend doesn't support 64bit values?

I was referring to my newCTFE Bytecode-codegen.
It is separate from dmd's backend.

Just for completeness sake, it is perfectly possible to generate x86_64 code without supporting 64bit values, you will just have alot of zeros in the upper bits :)

dmd does support 64bit values of course.
March 13, 2017
On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote:
> Hi Guys, due to the old CTFE status thread getting to page 30, I am now starting a new one.
>
> [...]

Hey Stefan, you have been working on this for many months now: is someone funding your work?  If not, you should put up a bitcoin address or something, I know I'd contribute.
March 13, 2017
On Monday, 13 March 2017 at 15:49:35 UTC, Joakim wrote:
> On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote:
>> Hi Guys, due to the old CTFE status thread getting to page 30, I am now starting a new one.
>>
>> [...]
>
> Hey Stefan, you have been working on this for many months now: is someone funding your work?  If not, you should put up a bitcoin address or something, I know I'd contribute.

There's Patreon, but they don't support bitcoin currently.
March 13, 2017
On Monday, 13 March 2017 at 15:49:35 UTC, Joakim wrote:
> On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote:
>> Hi Guys, due to the old CTFE status thread getting to page 30, I am now starting a new one.
>>
>> [...]
>
> Hey Stefan, you have been working on this for many months now: is someone funding your work?  If not, you should put up a bitcoin address or something, I know I'd contribute.

Hi Joakim,

My work does get sponsored by the D Language Foundation.
Therefore any Donations best be directed to them.

If someone wants to support my work specifically it's best to contact me personally.

I have been thinking about setting up a Patreon account and decided it was too much trouble; considering that there is not a large number of people who even know my of work.

Cheers, Stefan


March 13, 2017
On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote:
> [ ... ]

I just fixed a bug in ref support;
It should now work with slices.

I also made it _slightly_ easier to make ABI changes for slice, since I expect the structure to change as soon as concat support is added.
(e.g. slices will get a refcount, capacity and an origin ptr)