Re: Calypso: Direct and full interfacing to C++

2015-02-18 Thread Kelly via Digitalmars-d-announce

Hello Elie,

I just pushed a small pull request for 
fromTypeTemplateSpecialization. I forgot to mention in the 
request that the changes allow bitset.d to be compiled and run 
again.


With those changes all the examples compile and run again. There 
are still two errors when compiling vector.d. Clang errors when 
making the pch file. LDC2 still runs and produces a working 
binary anyways.


Not sure what you are working on, but I can look at those errors 
if you like. Do you have an email address I can get in touch with 
you at? Jump on to #ldc on IRC and pm me if you don't want to 
post here.


I didn't look at the build errors on OS X again yet...got tired 
of build errors for  a bit :)


Thanks,
Kelly



Re: DlangIDE

2015-02-18 Thread Rainer Schuetze via Digitalmars-d-announce



On 17.02.2015 20:41, Vadim Lopatin wrote:

It looks like we need to develop some universal debugger library.
For linux, it can use gdb as a backend.
For windows - I'm not sure. Is there any console debugger which can
debug dmd generated executables? I've checked windbg shipped with dmd,
but it looks like it is GUI, and cannot be used as backend via console.
Trying to play with my own implementation of debugger using win32 API.

Probably there is already some debugger interface written in D?


On Windows, there is mago (https://github.com/rainers/mago), a debug 
engine that integrates with Visual Studio, but it's actually not limited 
to that. It might be rather complicated to host it, though, you'll have 
to interface with IDebugEngine2 and all its subclasses 
(https://msdn.microsoft.com/en-us/library/bb145310.aspx).


If you want a text interface, the Debugging Tools for Windows 
(https://msdn.microsoft.com/en-us/windows/hardware/hh852365) also 
contain cdb, a command line version of windbg (forget about the one 
distributed with dmd). For Win32, you'll have to convert the old 
CodeView debug info written by optlink to PDB format using cv2pdb, though.


Re: DlangIDE

2015-02-18 Thread Vadim Lopatin via Digitalmars-d-announce
On Wednesday, 18 February 2015 at 08:21:19 UTC, Rainer Schuetze 
wrote:



On 17.02.2015 20:41, Vadim Lopatin wrote:
It looks like we need to develop some universal debugger 
library.

For linux, it can use gdb as a backend.
For windows - I'm not sure. Is there any console debugger 
which can
debug dmd generated executables? I've checked windbg shipped 
with dmd,
but it looks like it is GUI, and cannot be used as backend via 
console.
Trying to play with my own implementation of debugger using 
win32 API.


Probably there is already some debugger interface written in D?


On Windows, there is mago (https://github.com/rainers/mago), a 
debug engine that integrates with Visual Studio, but it's 
actually not limited to that. It might be rather complicated to 
host it, though, you'll have to interface with IDebugEngine2 
and all its subclasses 
(https://msdn.microsoft.com/en-us/library/bb145310.aspx).


If you want a text interface, the Debugging Tools for Windows 
(https://msdn.microsoft.com/en-us/windows/hardware/hh852365) 
also contain cdb, a command line version of windbg (forget 
about the one distributed with dmd). For Win32, you'll have to 
convert the old CodeView debug info written by optlink to PDB 
format using cv2pdb, though.


I'll check mago, thank you!


Re: Packt is looking for someone to author a Learning D

2015-02-18 Thread Russel Winder via Digitalmars-d-announce
On Wed, 2015-02-18 at 09:56 +, Kagamin via Digitalmars-d-announce
wrote:
[…]
 Isn't latex for document restyling? What you would use it for? 
 There's little time to only write the text, let alone fiddling 
 with styles and typesetting. Word is better in this sense that it 
 gets the end result just by saving the document.

(Xe|Lua)LaTeX (or LaTeX 3) is an authoring tool, but then using the same
source form it becomes a typesetting tool. No need to change the tools
to change the role.

LaTeX (and AsciiDoc) files are mergeable and hence can be stored in a
VCS repository very easily. Word files are just binary blobs. Perhaps
for individual working there is a who cares possibility, but for joint
authoring a VCS repository provides a shared, managed store. VCS and
binary blobs are a waste of time, so if you author with binary blobs you
can't really do joint authoring, unless you impose sequential access. I
have tried using a wrapper around FrameMaker files to achieve locking,
technology works, authoring process sucks. Think using SCCS or RCS. 

-- 
Russel.
=
Dr Russel Winder  t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Roadm: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


signature.asc
Description: This is a digitally signed message part


quick-and-dirty minimalistic LISP engine

2015-02-18 Thread ketmar via Digitalmars-d-announce
here is my little contribution to the everlasting how you shouldn't 
write the code contest. this is very simple (yet fully working) LISP 1 
implementation. it is slow like a dead snail, it trashing memory faster 
than you can say WTF?!, but it does it's job.

this code was ripped out of closed-source project, so no git this time, 
sorry.

yes, it has both automatic function wrapping and ability to call LISP 
functions without manual list building.

and yes, it is really used in real software.

Public Domain / WTFPL.

http://ketmar.no-ip.org/milf_for_the_masses.zip

signature.asc
Description: PGP signature


Re: Packt is looking for someone to author a Learning D

2015-02-18 Thread Kagamin via Digitalmars-d-announce
On Sunday, 15 February 2015 at 04:38:08 UTC, Craig Dillabaugh 
wrote:

Just my personal opinion as one who recently finished a 200 page
thesis in Latex, and is now working for a company where we do 
all
our internal documents in Word. Latex certainly has its ugly 
warts,

but it is so nice for lengthy document1.


Isn't latex for document restyling? What you would use it for? 
There's little time to only write the text, let alone fiddling 
with styles and typesetting. Word is better in this sense that it 
gets the end result just by saving the document.


Re: quick-and-dirty minimalistic LISP engine

2015-02-18 Thread MattCoder via Digitalmars-d-announce

http://ketmar.no-ip.org/milf_for_the_masses.zip


I'd like to see the source but on the other hand I'm so afraid to 
download this zip. :)


Matheus.


Re: quick-and-dirty minimalistic LISP engine

2015-02-18 Thread via Digitalmars-d-announce

On Wednesday, 18 February 2015 at 21:22:56 UTC, MattCoder wrote:

http://ketmar.no-ip.org/milf_for_the_masses.zip


I'd like to see the source but on the other hand I'm so afraid 
to download this zip.


Yep, I got aliced on the first line...


Re: quick-and-dirty minimalistic LISP engine

2015-02-18 Thread ketmar via Digitalmars-d-announce
On Wed, 18 Feb 2015 22:31:00 +, Ola Fosheim Grøstad wrote:

 On Wednesday, 18 February 2015 at 21:22:56 UTC, MattCoder wrote:
 http://ketmar.no-ip.org/milf_for_the_masses.zip

 I'd like to see the source but on the other hand I'm so afraid to
 download this zip.
 
 Yep, I got aliced on the first line...

yet you're still alive, so at least it's not fatal. i've cleaned the code 
a little since publication, but i don't want to remove Alice traces again 
and again, so let's consider code cleanup as an exercise for the reader. 
i know that everybody loves textbooks where the most interesting part is 
left as an exercise.

signature.asc
Description: PGP signature


let (x,y) = ...

2015-02-18 Thread thedeemon via Digitalmars-d-announce

Creating tuples and returning them from functions is trivial in D:

auto getTuple() { return tuple(Bob, 42); }

but using them afterwards can be confusing and error prone

auto t = getTuple();
writeln(name is , t[0],  age is , t[1]);

I really missed the ML syntax to write

let (name, age) = getTuple();

Turns out this is ridiculously easy to implement in D, so here's 
my very tiny module for this:


https://bitbucket.org/infognition/dstuff/src (scroll down to 
letassign.d)


It allows you to write:

int x, y, z, age;
string name;

let (name, age) = getTuple();   // tuple
let (x,y,z) = argv[1..4].map!(to!int);  // lazy range
let (x,y,z) = [1,2,3];  // array

SomeStruct s;
let (s.a, s.b) = tuple(3, piggies);

If a range or array doesn't have enough elements, this thing will 
throw, and if it's not desired there's

let (x,y,z)[] = ...
variant that uses just the available data and keeps the rest 
variables unchanged.


Re: quick-and-dirty minimalistic LISP engine

2015-02-18 Thread via Digitalmars-d-announce

On Wednesday, 18 February 2015 at 22:37:34 UTC, ketmar wrote:

yet you're still alive, so at least it's not fatal


I became one year older, but I feel invigorated after this Alice 
encounter!


and again, so let's consider code cleanup as an exercise for 
the reader.


That's quite ok. I enjoy just looking at D code by different 
authors to get a picture of how the language is used in real 
code. So thanks for sharing!


i know that everybody loves textbooks where the most 
interesting part is left as an exercise.


Yes, especially if you get that part on an exam later on...


Re: Calypso: Direct and full interfacing to C++

2015-02-18 Thread Elie Morisse via Digitalmars-d-announce

On Wednesday, 18 February 2015 at 08:52:33 UTC, Kelly wrote:

Hello Elie,

I just pushed a small pull request for 
fromTypeTemplateSpecialization. I forgot to mention in the 
request that the changes allow bitset.d to be compiled and run 
again.


Thanks for looking into this, I'll check your PR.

With those changes all the examples compile and run again. 
There are still two errors when compiling vector.d. Clang 
errors when making the pch file. LDC2 still runs and produces a 
working binary anyways.


Not sure what you are working on, but I can look at those 
errors if you like.


Are these errors occurring when Clang generates the PCH or later 
in the semantic pass? There might be errors during the 
instantiation of member functions of class templates because 
Calypso tries to instantiate everything (whereas Clang 
instantiates them lazily), but it's no big deal, later they'll be 
made silent.



BTW I just pushed support for function template instantiation.

So lately thanks to a bit of free time there has been quite a lot 
of new features implemented: overloaded operators, function 
templates, and groundwork for class value types (they were added 
to the AST as a new semi-hackish kind of type, they make mapping 
any C++ type possible but they can't be used directly from D code 
yet).


Operators should make std::map usable, so I'm going to resume 
testing further STL types.


Re: Packt is looking for someone to author a Learning D

2015-02-18 Thread Kagamin via Digitalmars-d-announce
Well, Word can diff and merge documents, though, it works with 
sharepoint, not vcs.


Re: quick-and-dirty minimalistic LISP engine

2015-02-18 Thread Stefan Koch via Digitalmars-d-announce

Oh boy.
the source is messy ...


Re: quick-and-dirty minimalistic LISP engine

2015-02-18 Thread ketmar via Digitalmars-d-announce
On Wed, 18 Feb 2015 11:56:51 +, Stefan Koch wrote:

 Oh boy.
 the source is messy ...

you have been warned! ;-) it was actually created within several hours to 
add simple scripting to another project, and i have no plans to improve 
it. so i decided to make it public, in a hope that it might be useful for 
somebody, and to show how one shouldn't write D code. ;-)


signature.asc
Description: PGP signature


We are Beta (2.067.0-b2)

2015-02-18 Thread Martin Nowak via Digitalmars-d-announce

Find more information on the dmd-beta mailing list.
http://forum.dlang.org/thread/54e41ca2.4060...@dawg.eu


Re: quick-and-dirty minimalistic LISP engine

2015-02-18 Thread ketmar via Digitalmars-d-announce
On Wed, 18 Feb 2015 22:37:34 +, ketmar wrote:

 On Wed, 18 Feb 2015 22:31:00 +, Ola Fosheim Grøstad wrote:
 
 On Wednesday, 18 February 2015 at 21:22:56 UTC, MattCoder wrote:
 http://ketmar.no-ip.org/milf_for_the_masses.zip

 I'd like to see the source but on the other hand I'm so afraid to
 download this zip.
 
 Yep, I got aliced on the first line...
 
 yet you're still alive, so at least it's not fatal. i've cleaned the
 code a little since publication, but i don't want to remove Alice traces
 again and again, so let's consider code cleanup as an exercise for the
 reader. i know that everybody loves textbooks where the most interesting
 part is left as an exercise.

p.s. here is newer aliced version, if someone is still interested:
http://ketmar.no-ip.org/milf.d

not really better than previous one, i just removed some copypasta and 
added automatic list deconstruction for primitives (see new 
`registerBuiltins()` for some samples).

signature.asc
Description: PGP signature


Re: We are Beta (2.067.0-b2)

2015-02-18 Thread Walter Bright via Digitalmars-d-announce

On 2/18/2015 6:13 AM, Martin Nowak wrote:

Find more information on the dmd-beta mailing list.
http://forum.dlang.org/thread/54e41ca2.4060...@dawg.eu


Thank you, Martin!


Re: New book: Developing with compile time in mind

2015-02-18 Thread Walter Bright via Digitalmars-d-announce

On 2/17/2015 9:02 AM, Andrei Alexandrescu wrote:

Guess I better find out what AsciiDoc is then. Wee, it has macros:
http://www.methods.co.nz/asciidoc/asciidoc.css-embedded.html#_macros


Ddoc leads the way in innovation again!