I've heard that our company is considering the T20 from Toradex.com for
a new project with remote hardware. The platform runs on Nvidia Tegra
and Linux.
Since I have been very impressed by the D programming language, for some
years now, could it be possible to use D in such projects?
If you really need that you could use the import expression to mixin your
unittests.
But you should really put the unittests next to the tested code. A good
editor could fold it anyway.
For a language that aims at C/C++'s domain, it's extremely depressing
that this is still the case. I *really* think this needs to be one of
D's top
priorities at this point. I honestly see it as D's #1 biggest glaring
hole
We have much bigger problems that need attention.
And there's
At least for gdc only hello-world like code works. Real code hits this
issue:
https://bitbucket.org/goshawk/gdc/issue/215/alignment-of-struct-members-wrong-on-arm
Did you ever try with LDC?
Am 31.08.2011, 12:05 Uhr, schrieb maarten van damme
maartenvd1...@gmail.com:
Am I sure those functions aren't shift around during optimization?
No. It's just an ugly hack and likely to go up in flames.
Also what you try could only work with PIC but even then...
for now the function is
I'd like to know how to read from stdin one character at a time, read
with whitespace as a delimiter, and read line by line.
A nifty way of reading by byte is the undocumented (only the writer is
documented):
import std.stdio;
void main()
{
foreach(c; LockingTextReader(stdin))
A nifty way of reading by byte is
Of course I mean by character.
I looked at the dll documentation and I'm baffled by the time I get to
the first
line: __gshared HINSTANCE g_hInst; and then it starts talking about
dll_process_attach. I don't want to attach processes, I want to compute
an integer.
The Dllmain is needed so the D runtime is properly
Example:
https://bitbucket.org/trass3r/matd/src/tip/examples/mmfile/
Am 18.08.2011, 21:17 Uhr, schrieb Adam D. Ruppe
destructiona...@gmail.com:
We should make a mixin template DllMain that has a generic main.
We should also have a -shared switch that transparently includes all of
the boilerplate crap:
particularly the .def file, maybe even a default DllMain
Am 18.08.2011, 21:42 Uhr, schrieb Kai Meyer k...@unixlords.com:
2) check if there are any exported functions (via .def or export()), if
not, export them all
That's insane. Larger projects have tons of functions and may only need to
export a few.
The language includes the export keyword to
Am 12.08.2011, 13:35 Uhr, schrieb Jacob Carlborg d...@me.com:
On 2011-08-12 11:36, simendsjo wrote:
htod is a fork of dmc or something, right? How difficult is it to update
the program to make it more user friendly?
Is the source public? Would it be better to use gcc or clang instead?
htod is
htod is a fork of dmc or something, right?
Yep.
How difficult is it to update the program to make it more user friendly?
Only Walter can.
Is the source public?
No.
Would it be better to use gcc or clang instead?
Hell yeah. Clang's predestined for that.
I'm working on a tool to convert C header files to D modules based on
clang. But currently it's not a prioritized project.
I also played with the idea. Clang's Rewrite facilities should be
perfect for that.
Yeah, I'm using Rewrite, if I recall correctly.
Should really be a community effort
Maybe http://arsdnet.net/dcode/postgres.d
- Error: template std.concurrency.spawn(T...) cannot deduce
template function from argument types !()(void delegate())
As the message already tells a class method yields a delegate and not a
function.
Check if that method could be made static.
But if you really need to do it this way, you
Am 31.07.2011, 17:34 Uhr, schrieb Andrej Mitrovic
andrej.mitrov...@gmail.com:
Why is there both a System and Windows linkage type if they're the
same? Is this a C++ legacy?
Well Windows always means stdcall while System changes its meaning on
Posix.
http://d.puremagic.com/issues/show_bug.cgi?id=5739#c3
atk = DD-atk
DD-atk_static.rf: No such file or directory
Command c:\d\dsss-0.78-x86-windows\bin\rebuild.exe returned with code 1,
aborting.
Error: Command failed, aborting.
Doesn't dsss have some kind of verbose mode?
Did you try with another build tool?
What is the command line?
rdmd segfaults on me using this:
c:\temprdmd --build-only --chatty -I\d\ext\gtkd\src t.d
dmd -I\d\ext\gtkd\src -v -o- t.d -I. t.d.deps
dmd -I~/coding/gtkD/src/ -L-ldl -v -o- 'test.d' -I'.' test.d.deps
dmd '@/tmp/.rdmd/rdmd.6FC1F920EA8D2136FC5ECC4E5ED4404A.rsp'
with
So your command line is simply rdmd --build-only --chatty
-I\d\ext\gtkd\src -L-ldl t.d?
Yes, and in theory that would be enough.
(if it didn't put 'dmd' in the .rsp)
rdmd calls dmd -I\d\ext\gtkd\src -L-ldl -v -o- t.d -I. t.d.deps,
and then segfaults (win7x64).
Doesn't segfault on Linux
dmd.d...?
That's what I was talking about.
it calls dmd @...rsp and rsp contains dmd again.
So it in fact calls dmd dmd ...
We should really get rid of the response file crap and call dmd directly.
This would also clean up rdmd --dry-run
The -L-ldl isn't recognized by optlink.
OPTLINK : Warning 9: Unknown Option : LDL
What's the equivalent?
I think you don't need it on Windows.
But according to the demo dsss.conf files you might need -lladvapi32
Might also be -L-Ladvapi32.
It tries to pick up zlib1.dll from my Intel WiFi
Seems I could use github direcly:
https://github.com/D-Programming-Language/tools/pull/3
Thanks!
But we should really also try to track down why rdmd crashes on Windows.
There is something wrong with either dmd or rdmd though..
If I compile rdmd (with my patch, haven't tried the original) without
-g, it crashes when trying to compile anything...
Does this also happen if you compile it with -g and then run cv2pdb on it?
http://prowiki.org/wiki4d/wiki.cgi?DatabaseBindings
There is some information, but it's probably outdated.
Please update that wiki once you know more :)
Apart from that I only know of this binding:
http://dsource.org/projects/ddbi
I cannot compile anything without first compiling rdmd with -g.
Compiling rdmd with -g and running cv2pdb on it works.
Really strange.
If we just had a stack trace.
Am 19.07.2011, 20:49 Uhr, schrieb Adam Ruppe destructiona...@gmail.com:
foreach(line; mysql.query(select id, name from users where id ?,
5)) {
// access to columns by name
writefln(%s: %s, line[id], line[name]);
// alternatively, you can write:
Whats the best way to debug this? Sprinkle printf's around?
Probably. Should happen in that getDependencies function, shouldn't it?
Someone want to look at the assembly? The .exe is to large for the
newsgroup, so only the code is attached. I've only tried compiling with
dmd 2.054
Maybe you could post only rdmd.obj?
The DataObject is found in database.d - it is meant to work generically
with any database backend.
Damn, we should really have a common project for database stuff.
Am 14.07.2011, 16:36 Uhr, schrieb Danny Arends danny.are...@gmail.com:
Hey all,
I'm trying to build a D application which statically links in the the
blas and lapack libraries
(from http://icl.cs.utk.edu/lapack-for-windows/clapack/index.html ).
When downloading the
pre-build libraries
Anybody an idea?
Am 13.07.2011, 16:02 Uhr, schrieb Steven Schveighoffer
schvei...@yahoo.com:
void h() {}
class Bla
{
mixin wrap!h;
}
mixin template wrap(alias f)
{
void blub(alias g = f)()
{
g();
}
}
As a workaround, is there a reason you need blub to be
Am 13.07.2011, 16:58 Uhr, schrieb Tyro[a.c.edwards] nos...@home.com:
Don't know it this is the right answer or a possible bug but it does the
trick:
void h() { import std.stdio; write(h()); }
class Bla
{
mixin wrap!h;
}
mixin template wrap(alias f)
{
void blub(typeof(f) g = f)
I've seen this error before...
*searches memory and old code*
Here you go: http://d.puremagic.com/issues/show_bug.cgi?id=3051
I think this is yet another issue.
The inner template argument is not something on the stack but it is a
template argument.
You should declare the function pointer without the extern(C).
Example:
alias int function(void* test) FTInitFunc;
extern(C) int foo(void* test){ }
FTInitFunc foo_ptr = foo;
This worked for me.
That's a bug.
Is this a bug? If not, how do you make it work?
void h() {}
class Bla
{
mixin wrap!h;
}
mixin template wrap(alias f)
{
void blub(alias g = f)()
{
}
}
void main()
{
Bla b = new Bla();
b.blub();
}
test.d(18): Error: template instance cannot use
Am 13.06.2011, 23:55 Uhr, schrieb Peter Alexander
peter.alexander...@gmail.com:
I'm trying to run the test suite for DMD, but I'm running into issues.
Do I need to set up my environment differently to run dmd in
development? How can I get around this?
To quote IRC:
In theory it's simple:
Am 12.07.2011, 20:57 Uhr, schrieb David Nadlinger s...@klickverbot.at:
or use your normal system-wide installation which probably has all the
paths set up correctly by specifying the DMD variable: »make
DMD=/usr/local/bin/dmd«.
Thanks a lot for that hint!
Is this going to be fixed any time soon? Allowing callbacks with D
calling convention where a C callback is expected should be an error,
and this is like the 10th time I've ran into this bug.
http://d.puremagic.com/issues/show_bug.cgi?id=3797
Am 06.07.2011, 16:15 Uhr, schrieb teo teo.ubu...@yahoo.com:
What is the best way to translate following to D?
#define MAKELONG(a, b) \
((LONG) (((WORD) (a)) | ((DWORD) ((WORD) (b))) 16))
The point is I would like to be able to use that at compile-time. The
macro is supposed to define
If you want it to by dynamic all the way, you need to put
the dimensions in the parens like above. Personally, I _never_ put them
in the brackets, even when the dynamic array has just one dimension.
It's just
simpler to always put them in the parens and not worry about it.
Maybe we should
Starting my cl4d executable with 'gdb main -readnow' results in
Reading symbols from main...expanding to full symbols...Die:
DW_TAG_type_unit (abbrev 4, offset 0x6a)
parent at offset: 0xb
has children: FALSE
attributes:
DW_AT_byte_size (DW_FORM_data1) constant: 16
DW_AT_type
First: are you compiling *all* modules with -gc rather than -g?
Ah ok, somehow I was mislead into thinking that the gdb patches allow you
to use -g.
It works now though line numbers are more messed up than I'm used to from
cv2pdb + VS. There I only have the usual problems with mixins but
Am 14.06.2011, 02:43 Uhr, schrieb Loopback elliott.darf...@gmail.com:
Thanks for all the answers! Seems like rdmd did the trick.
I don't see why this isn't built in to dmd though
No one does ;)
I've also stumbled upon an additional error with the win32 DirectX
bindings, but this seems D
Importing it means dmd knows about the function and emits a call but
doesn't automatically generate the function code.
This is only done if you also pass the file containing it to dmd.
Shouldn't the linker/compiler be able to solve this on its own then?
Use rdmd or xfBuild to automatically compile all needed modules.
http://h3.gd/code/nucleus/
I lol'd at the suggestion to upgrade my FF4 to a modern HTML5-compliant
browser.
^^ No problems with Opera.
Both tools are dead.
Am 07.06.2011, 23:02 Uhr, schrieb Fabian contact-...@freenet.de:
I can't see any changes on this web page:
http://www.dsource.org/projects/dwt/wiki
That doesn't mean anything.
Development sometimes takes place behind the scenes or in forks at github
or bitbucket.
- The D compiler has only bad code optimization
Yep, but there is LDC and GDC which use LLVM and GCC as backends
respectively.
- There are no maintained GUI libraries
I wouldn't agree with that. Some people are still working on GtkD, QtD and
DWT.
- The development of the compiler is
Am 30.05.2011, 04:09 Uhr, schrieb Jeff Slutter mrmust...@gmail.com:
One of the things that's important to us is being able to link against
some existing C/C++ static libraries (built with VS 2008, so PE COFF
format).
Good luck with that. DLLs are no problem but static libraries are another
Read about import types here:
http://www.digitalmars.com/d/2.0/module.html#ImportDeclaration
Very interesting benchmarks!
Have a look at the recent thread titled 'How To Dynamic Web Rendering?'
Adam Ruppe has created a package for web development with D and it seems
to work like a charm.
Thanks, Trass3r et al! I'll give it a try in D, then.
Of course you can't create 64Bit dlls though ;)
Am 19.05.2011, 22:28 Uhr, schrieb Graham Fawcett fawc...@uwindsor.ca:
Hi folks,
I've only used D on Linux so far, so I'm not clear on the current
shared-library story on Windows. Consider an existing C++ application
that
can be extended by writing plugins, which are usually written in C or
(I've already successfully created and used Matlab .mex/.dll plugins with
D)
Could it be a stack corruption?
string[] funcs = [tan];
calling mixin a compile time has the following error...
Error 1 Error: variable func cannot be read at compile time
C:\D\SVNProjects\trunk\xcellD\xcell1\trig.d 22
That's because funcs is mutable.
Try to make it immutable or enum.
foreach runs at runtime, while mixin is expanded at compile time.
Not the whole truth though.
foreach over tuples gets unrolled at compile time so you can do stuff like:
// +=, -=, ...
Vector opOpAssign(string op, U)(U s)
{
foreach (i, _; tuple)
mixin(tuple[i] ~ op ~
object.d: Error: module object is in file 'object.d' which cannot be read
import path[0] = /etc/../../src/phobos
import path[1] = /etc/../../src/druntime/import
As you can see dmd.conf uses relative paths.
That guide needs an overhaul.
The easiest way is to copy the contents of the zip archive
object.d: Error: module object is in file 'object.d' which cannot be
read
Specify path to file 'object.d' with -I switch
Could it be you also deleted the dmd.conf in the local dmd/linux/bin?
Is there a copy of the official D grammar somewhere online? I wrote a
lexer for my Compiler class and would love to try and apply it to
another grammar.
The official D grammar is spread among the specification.
But I recall that someone compiled a complete grammar for D1 some time ago.
nedbrek Wrote:
2) What is the best way to make the same declarations work for D1 and D2?
It seems everything inside a version statement must parse correctly, and
D1 doesn't want to parse immutable(char)...
You may also use versioned aliases.
Just include the D2 code via a string mixin to
I'm having trouble passing D strings (char[]) to SDL, in particular
SDL_LoadBMP(), I keep receiving a segfault.
Heres the code:
void setImg(string path) {
// concat null terminating char to string and cast to c type string
when
// passing to SDL_LoadBMP()
path ~= \0;
image =
... or does enumerations only support constant-expressions? Thanks!
Yep, enum is a compile-time thing.
bearophile Wrote:
It seems t is not useful...
Yep, foreach over tuples is kinda messed up.
Same with reference tuple foreach:
http://d.puremagic.com/issues/show_bug.cgi?id=2411
Direct access doesn't work but accessing via [i] does.
Am 01.03.2011, 23:33 Uhr, schrieb bearophile bearophileh...@lycos.com:
Do you know why DMD doesn't give a compilation error here?
import core.stdc.stdio: sscanf;
immutable int value = 5;
void main() {
sscanf(10.ptr, %d.ptr, value);
}
What's the D signature of sscanf?
http://www.dprogramming.com/ini.php
I am trying to implement a D2 function that has this C signature (it
gets called from a C module and I cannot change the caller):
extern(C) read_into(char *buffer, size_t buf_len);
I would like to use D's vector (or array-wise according to TDPL)
operations on buffer but I cannot find a way, how
Why doesn't this work:
import std.stdio;
void main()
{
float a,b=0;
writefln(%x %x, a, b);
}
std.format.FormatError: std.format floating
I've found a few OpenGL projects, like bindings
(http://www.dsource.org/projects/bindings/) and derelict
(http://www.dsource.org/projects/derelict/), but I still can't find any way to
easily use or install them (for D2 on Ubuntu).
Use derelict2 from svn and xfBuild. Then you just need to tell
However, I need the resources to be freed more quickly than the GC is
apparently doing
You could use scoped instances if you need to clean them up soon after
creation.
Are debug symbols compiled with -gc stored in a separate file? Visual
Studio refuses to debug my things
Nope.
Plus you need to use cv2pdb to debug with Visual
As Simen said, there was an attempt to create an IL backend but it hasn't
been updated since Aug 2009 and even it compiled you probably wouldn't
have much fun with it.
You could try to use a C bridge. But even then, I don't see the benefit.
Save this somewhere or it will be lost here ;)
Why do they exist and why does typeof(this) strip constness?
import std.stdio;
struct S
{
const void foo(this T)(int i)
{
writeln(typeid(T));
}
const void bar()
{
writeln(typeid(typeof(this)));
}
}
void main()
{
const(S) s;
(s).foo(1);
S s2;
2. What is the reason for Phobos defining param funcs as template
params?
Correct me if I'm wrong but there's no way to pass an arbitrary
function to a function in a type-safe way. If you use pointers and
casts you can't check if the passed function meets certain
requirements (parameters, return
How do you not pass them in a safe manner? If you are casting things,
of course you don't get type safety.
Yep, I was talking about non-template functions.
Only way to pass an arbitrary function is via void*
I can't seem to find something like that in phobos.
Is it missing or am I overlooking it?
The problem is it uses a Mercurial repository.
Speaking of COM.. has anyone successfully used COM interfaces in D2?
I once tried to create a DDraw proxy dll but I can't remember how good it
worked.
https://bitbucket.org/trass3r/ddrawproxy
Object is only the base class for all D classes. Interfaces may also
represent COM objects or C++ classes, which are not subclasses of
Object.
Can't the compiler check if it is a normal D interface and then allow
(implicit) casts to Object?
class Foo
{
int x;
int y;
int z;
mixin NonSerialized!(z);
}
Had a quick look at
http://dsource.org/projects/orange/browser/orange/serialization/Serializable.d
1. How come it works without 'mixin' in the template declaration (mixin
template NonSerialized)?
2. What if
template foo (args...) {}
Does that work with aliases?
Well at least the following compiles:
template Foo(T...,)
{
int i;
}
int a,b;
alias Foo!(a,b) f;
. Has anybody else encountered this? (dmd 2.051)
I already disabled unittests but this didn't help.
(my code is at http://bitbucket.org/trass3r/cl4d)
http://d.puremagic.com/issues/show_bug.cgi?id=5373
http://planet.dsource.org/
Problem is: it's not very active, and also, apparently people don't know
about it :-)
Yeah haven't heard of it in all those years!
Also make sure you use globals properly if you use them (shared,
__gshared, etc.)
Should I change my C compiler? Or, there is another way to covert static
library from COFF to OMF??
coff2omf should work, but unfortunately it isn't free.
coffimplib is free, but can only convert import libraries.
You may try to use objconv: http://www.agner.org/optimize/#objconv
Though it
I used it to convert static library, and it says the input library is
not import library.
That's coffimplib.
coff2omf is in the Extended Utilities Package which is sold for 15$.
Many existing C libraries are not written as dynamic libraries. Some C
libraries can be
compiled as DLL, but in
I'm trying to make some home-grown d build system, but and one of my
tasks
is to get module dependencies. Yes, I know about -deps DMD switch, but
it works
when all needed modules are given to compiler. But if some dependencies
absent compiler
just aborts with error module foo is in file
module testObj;
public interface testInterface {
void someMethod();
}
public class testObj
{
Object someCaller;
this(Object caller) {
someCaller = caller;
}
this(testInterface tI, bool xyz) {
someCaller = tI;
}
}
It was quite hard to track that one down.
In the following example the import statement was mixed into the class
among other code so it wasn't as obvious as here.
import std.traits;
class Foo
{
import std.string;
static assert(isNumeric!int);
}
foo.d(6): Error: template
That is what I am missing, a stack trace.
How do I see a stack trace? dmd1(win)
Well tango includes stack traces if you import the right module.
For D2/Win use http://3d.benjamin-thaut.de/?p=15
hmm I remember http://www.dsource.org/projects/lyla
There also were some others at dsource
This, I do not understand. I thought immutable applies to the value, not
to the variable.
You need to read from right to left.
immutable(char)[] is a mutable array of immutable chars.
immutable(char[]) is an immutable array of immutable chars. Note the
transitivity.
If this isn't in bugzilla, please file a bug report.
http://d.puremagic.com/issues/query.cgi
101 - 200 of 315 matches
Mail list logo