Re: Serverino 0.7.0

2024-04-14 Thread aberba via Digitalmars-d-announce

On Saturday, 13 April 2024 at 16:24:52 UTC, Andrea Fontana wrote:

 Hey Serverino enthusiasts! 

Get ready to elevate your server game with the latest Serverino 
0.7.0 release! ✨


What’s new in this update? 

WebSockets are here! Now you can enjoy real-time bi-directional 
communication.


Some example I've posted on twitter:
https://twitter.com/twittatore/status/1775969115322147165
https://twitter.com/twittatore/status/1776613077053481078
https://twitter.com/twittatore/status/1774827657512841363


Have fun!
Andrea



Link to code sample?


Re: Release D 2.108.0

2024-04-01 Thread aberba via Digitalmars-d-announce

On Monday, 1 April 2024 at 22:34:14 UTC, Iain Buclaw wrote:

Glad to announce D 2.108.0, ♥ to the 36 contributors.

This release comes with 8 major changes and 36 fixed Bugzilla 
issues, including:


- In the language, named arguments for functions have been 
implemented and documented.

- In phobos, std.uni has been upgraded to Unicode 15.1.0.
- In dub, the fetch command now supports multiple arguments, 
recursive fetch, and is project-aware.


http://dlang.org/download.html
http://dlang.org/changelog/2.108.0.html

As usual please report any bugs at
https://issues.dlang.org

-Iain
on behalf of the Dlang Core Team


Awesome. Cheers to all contributors.



Re:  Announcing Serverino 0.6.0! 

2024-03-10 Thread aberba via Digitalmars-d-announce

On Thursday, 7 March 2024 at 21:00:03 UTC, Andrea Fontana wrote:
Performance has been boosted once again, and those pesky little 
bugs? Squashed! Plus, there are fresh examples to try out and 
even a sleek new logo to admire!


Ready to dive in? Just spin up a new project using the provided 
template:


```
dub init -t serverino my_wonderful_project
cd my_wonderful_project
dub
```

And voilà! Your hello world will be up and running in **a 
couple of seconds**! 



Have fun!
Andrea Fontana

(I know some of you are already on board, but how many are 
sailing in secret? Come out of the shadows and let me know! 
Your feedback is the wind in serverino's sails)


Repository: https://github.com/trikko/serverino
Docs: https://trikko.github.io/serverino
Examples: 
https://github.com/trikko/serverino/tree/master/examples

Tips: https://github.com/trikko/serverino/wiki/


I'm a heavy user of big express (js) library and I like what I'm 
seeing. Looks simple and clean. Here are some suggestions:


1) I'm not sure I like concat (~=)
 style used on `Output output` and how it can determine the 
order routes are invoked. I would expect that to be explicitly 
defined by Dev using a catch-all route or else the sever returns 
404 by default. That's going to prevent the chances of invoking 
the wrong route especially when it does something 
important/dangerous/unexpected.



2) instead of doing:

```d
if (request.method != Request.Method.Get)
output.status = 405;
```

to determine the request method, why not use a UDA similar to 
`@route` ...like `@method(Request.Method.post)`? The use of UDA 
is so much cleaner and easier to deal with.



3) would be nice to have an `output.json()` function which both 
sets the response header and also calls `output.write()`


4. I can't build anything significant in any http server library 
without support for middleware. Preferably support for multiple 
middlewares functions. A middleware would be a function that runs 
after the @onServerInit but BEFORE any route handler. It will be 
used to intercept all incoming requests for things like 
authentication, rate limiting, CORS, etc. Preferably provide a 
way to pass data to the target route e.g. user session, user 
permission, etc...like output.locals.set("userId", 123). The 
route will then be able to access this data.



All in all, everything else looks good. I would prefer something 
like:


```d
void hello (Request req, Response res) {
res.write("hello");
}
```
...but `Output` is also fine... just a small nitpick.



Re: SecureD 3.0 has been released!

2024-03-07 Thread aberba via Digitalmars-d-announce

On Wednesday, 6 March 2024 at 07:47:04 UTC, Adam Wilson wrote:
SecureD 3.0 has been released. This version was set in motion 
by a Cedric Picard, a D community member with Cryptography ...




And I even remembered to update the examples in the README.


+1

I wish more packages did this




Re: Released vibe.d 0.10.0

2024-02-19 Thread aberba via Digitalmars-d-announce

On Monday, 19 February 2024 at 08:45:28 UTC, Sönke Ludwig wrote:
The next release of vibe.d (0.10.0) is expected to land sooner 
than usual and will contain a substantial restructuring of the 
package structure. All low level modules that are currently 
sub packages of "vibe-d" will be broken out to separate 
standalone packages, as well as the "vibe-d:http" package. 
This will pave the way for *finally* being able to work 
towards integrating the work on a HTTP/2 implementation that 
was carried out by Francesco Galla during SAoC 2018.


0.10.0 is now out and is identical to 0.9.8, apart from the new 
package structure: 
https://vibed.org/blog/posts/vibe-release-0.10.0


Compatibility with the old structure is still there, but will 
get deprecated in one of the next releases, so a dependency 
like "vibe-d:http" 0.9.x should eventually be adjusted to 
"vibe-http" 1.x.x.


On the tutorials section of the vibed.org site, the are links to 
tutorials on my website (aberba.com) however I recently rebuilt 
my website and the links will need adjustment. I can't however 
find where the make a PR for that.


Re: Released vibe.d 0.9.8

2024-02-18 Thread aberba via Digitalmars-d-announce

On Friday, 16 February 2024 at 17:17:35 UTC, Sönke Ludwig wrote:
Just a quick announcement for a new vibe.d release that, 
probably most notably, gets rid of most DIP1000 related... as 
well as requiring REST interfaces to be fully @safe.


How does this affect regular code? What are the implications?


Re: Fluid 0.6.0 — UI library for D

2024-02-04 Thread aberba via Digitalmars-d-announce
On Wednesday, 31 January 2024 at 09:34:06 UTC, Bastiaan Veelo 
wrote:

On Wednesday, 31 January 2024 at 06:38:17 UTC, aberba wrote:
On Thursday, 25 January 2024 at 12:33:31 UTC, cookiewitch 
wrote:
Fluid is a library I started developing 3 years ago when I 
joined the D community, after failing to find a suitable 
library for my gamedev project.

[...]


Could you have a small documentation website? Could even be 
based on something like GitHub pages or readthedocs 
(https://readthedocs.io).


There is this https://fluid.dpldocs.info/v0.6.1/fluid.html and  
https://fluid.dpldocs.info/v0.6.1/fluid.showcase.html.


-- Bastiaan.


I think we all should learn to market our projects to appeal to 
more users. I've always thought that's why a number of great D 
project don't end up getting used because their maintainers do a 
poor job marketing them.


This should be on the readme along with sample code.


Re: Fluid 0.6.0 — UI library for D

2024-01-30 Thread aberba via Digitalmars-d-announce

On Thursday, 25 January 2024 at 12:33:31 UTC, cookiewitch wrote:
Fluid is a library I started developing 3 years ago when I 
joined the D community, after failing to find a suitable 
library for my gamedev project. Developing user interfaces 
through websites, games or applications is something I've spent 
a significant amount of time in the past, so I saw this as an 
opportunity for developing a solution that combines the best 
aspects of different frameworks I have previously used, whereas 
targeted at web browsers, mobile applications, games or 
desktop. Similarly to how many praise D for being both great 
for prototyping and amazingly scalable, I found that I would 
love to build something that shares both of those traits.


[...]


Could you have a small documentation website? Could even be based 
on something like GitHub pages or readthedocs 
(https://readthedocs.io).


Re: jsoniopipe now supports JSON5

2023-12-29 Thread aberba via Digitalmars-d-announce

On Friday, 29 December 2023 at 18:26:20 UTC, aberba wrote:

On Friday, 29 December 2023 at 08:04:31 UTC, Zz wrote:

https://forum.dlang.org/post/u5361j$2tfv$1...@digitalmars.com

On Monday, 29 May 2023 at 21:38:54 UTC, Steven Schveighoffer 
wrote:

https://code.dlang.org/packages/jsoniopipe

This little project is one that I've tinkered with for a long 
time, I use it in a few places.


I just updated it to support [JSON5](https://json5.org), 
which is a format much more suited to configuration than 
straight JSON.


AFAIK, this is the first D project that parses JSON5!

-Steve


Hi,

Any plans on having an interface similar to std.json?

Regards,
Zz



Last time I took a look at iopipe, it was unclear how to even 
do a basic example with no docs available. I when for 
vibe_data_json package


std_data_json


Re: jsoniopipe now supports JSON5

2023-12-29 Thread aberba via Digitalmars-d-announce

On Friday, 29 December 2023 at 08:04:31 UTC, Zz wrote:

https://forum.dlang.org/post/u5361j$2tfv$1...@digitalmars.com

On Monday, 29 May 2023 at 21:38:54 UTC, Steven Schveighoffer 
wrote:

https://code.dlang.org/packages/jsoniopipe

This little project is one that I've tinkered with for a long 
time, I use it in a few places.


I just updated it to support [JSON5](https://json5.org), which 
is a format much more suited to configuration than straight 
JSON.


AFAIK, this is the first D project that parses JSON5!

-Steve


Hi,

Any plans on having an interface similar to std.json?

Regards,
Zz



Last time I took a look at iopipe, it was unclear how to even do 
a basic example with no docs available. I when for vibe_data_json 
package




Re: Browsers in D

2023-12-22 Thread aberba via Digitalmars-d-announce

On Thursday, 21 December 2023 at 22:29:03 UTC, Adam D Ruppe wrote:

On Thursday, 21 December 2023 at 11:55:50 UTC, aberba wrote:

[...]


Yeah, it is a solid choice with a long history. Did you know 
the Unix Printing System used to (I don't think it still does 
but im not sure) work this way? Some 15 years ago, it'd start 
up a local web server and you'd work with it through the 
browser.


[...]


Interesting. Security and privacy on the web is an illusion.


Re: D programming language overview video on Youtube

2023-12-21 Thread aberba via Digitalmars-d-learn

On Sunday, 17 December 2023 at 22:39:56 UTC, Witold Baryluk wrote:
I made a bit random video on D lang for noobs, and people who 
might be interested.


If you program more than one hour in D, do not watch it, but if 
you just found about D, feel free to check it out.


It is not too short, and unscripted, but should give general 
feel of D, its power, major features (with some live coding, 
and exploration of various aspects in real world, including 
debugging), maybe for people who just want to see what it is 
about. And high level overview of the project and features.


https://www.youtube.com/watch?v=_7Xg-E0NoNU


While I am not great at making videos, I think it is good to 
promote D any way possible, as it can compete in many places, 
like Python, Julia, Zig, but people rarely hear about D lang 
these days.





Re: Browsers in D

2023-12-21 Thread aberba via Digitalmars-d-announce

On Tuesday, 19 December 2023 at 21:15:19 UTC, Adam D Ruppe wrote:
I wrote a little blog about my browsers in D, with some 
discussion about how you might be able to embed them in your 
application too:


http://dpldocs.info/this-week-in-d/Blog.Posted_2023_12_18.html

With Firefox getting worse by the year, you might want to 
consider also making your own partially-usable chromium/edge 
skin (also known as "pukes")!


I have this idea of building a web view based desktop app with a 
webserver and db backend for CRUD functionality. This looks like 
a great option.


Re: Browsers in D

2023-12-21 Thread aberba via Digitalmars-d-announce
On Wednesday, 20 December 2023 at 14:24:45 UTC, Adam D Ruppe 
wrote:
On Wednesday, 20 December 2023 at 09:29:36 UTC, Paolo 
Invernizzi wrote:
When I was the CTO of my previous company, we embedded Gecko 
into a custom C++ GUI framework, to allow ALS people browse 
the web using gazes as an input method: it was a real pain ...


Wow, yeah, I know it must be possible, but I couldn't even 
figure out how to get started.


Like I said, pity Mozilla didn't recognize this use case, I 
think they could have really done something with it. Microsoft 
and WebKit (both from its KDE days and now with Apple in charge 
of it) have both really done a nice job making their things 
easy to adapt.


Lot's to say about Mozilla. There's the reason they've got that 
small market share. They lost focus on the real product they were 
offering


Re: Hipreme Engine v1.0.0 Announcement + iOS port

2023-12-21 Thread aberba via Digitalmars-d-announce

On Thursday, 21 December 2023 at 00:32:00 UTC, Hipreme wrote:

# Hipreme Engine v1.0.0 Announcement

Today, I'm glad to announce that Hipreme Engine is finally 
releasing its version 1.0. The 1000th commit marks the first 
release of this engine. There is a lot of work already done and 
a lot of work to be done. Some systems may find unstable 
support, such as Linux, which of course I'm willing to help, 
since it is not my development platform, it may not even work 
on the first run. But, even though this may happen, there is 
still a lot of work already done to be shown. It is the first D 
library with that quantity of abstraction done for making your 
work fully cross platform. But, with a lot of missing 
functionality, why announce right now?


[...]


Man I'm so happy to see this!


mysql-native v3.2.0 - the safe update

2023-12-16 Thread aberba via Digitalmars-d-announce

https://forum.dlang.org/post/xozbnrpxmgxboykir...@forum.dlang.org

On Tuesday, 14 February 2023 at 14:22:42 UTC, Rey Valeza wrote:
On Saturday, 23 April 2022 at 05:12:30 UTC, Steven 
Schveighoffer wrote:

[...]


Hi Steve, I just want you to know that I updated the Vibe.d 
tutorial I wrote last year to emphasize database operations 
using mysql-native and is now viewable here:


https://reyvaleza.gitbook.io/vibe.d-tutorial/

Thanks!


Awesome tutorial. I plan to do some vibe.d tutorials soon. This 
will come in handy.


Re: Beerconf December 2023

2023-12-04 Thread aberba via Digitalmars-d-announce
On Saturday, 2 December 2023 at 21:48:21 UTC, Steven 
Schveighoffer wrote:

# BEERCONF!

Beerconf this month is not on December 30-31, because that's 
new years eve.


It's not on December 23-24 because that's Christmas eve

So it's now down to December 16-17, which is in 2 weeks.

Note that even though I didn't get much response to the poll I 
posted on Beerconf scheduling, it seems like the majority of 
those who answered like the current schedule, so we will keep 
that.


Looking for the perfect gift for yourself? 
https://www.zazzle.com/store/dlang_swag/products?cg=196874696466206954


## What is beerconf?

Check out the [wiki article](https://wiki.dlang.org/Beerconf).

## Presentations?

If anyone has anything they want to share with the D world, 
please let me know via slack or discord and I will announce it 
here!


Cheers! 

-Steve


Once bought a hoodie on Dazzle but it never got processed.


OpenAPI Client Generator

2023-12-04 Thread aberba via Digitalmars-d-announce

https://forum.dlang.org/post/igxsajtxicyzfanrh...@forum.dlang.org

On Monday, 2 January 2023 at 10:08:23 UTC, Vijay Nayar wrote:
I would like to put an announcement for two new projects added 
to https://code.dlang.org.


https://code.dlang.org/packages/openapi-client

This project is an executable that reads an [OpenAPI 
Specification](https://spec.openapis.org/oas/latest.html) in 
JSON format and writes a D client to interact with the 
described REST API.


https://code.dlang.org/packages/stripe-client



Thanks for this.


Re: DConf Online 2021 T-Shirts

2021-11-15 Thread aberba via Digitalmars-d-announce

On Wednesday, 20 October 2021 at 09:55:32 UTC, Mike Parker wrote:
During DConf Online, we hand out prizes to random questioners, 
one per talk, and provide swag to each speaker. Each of the 
speakers will receive a DConf Online 2021 t-shirt, but only two 
questioners will (one per day). For everyone else, they're now 
available for sale in [the DLang Swag Emporium][1].


[...]



Would love a not-white hoodie though.


Re: D and C++ renderer side by side demonstration

2021-08-07 Thread aberba via Digitalmars-d-announce

On Saturday, 7 August 2021 at 07:11:26 UTC, kinke wrote:

On Saturday, 7 August 2021 at 03:15:30 UTC, Ki Rill wrote:


This is not a “X vs Y” video! It just demonstrates the 
capabilities of D and C++ side by side.


might easily mislead beginners, not helping D at all. What 
makes you think the used programming language would have any 
effect on the capabilities of a rendering engine?


Relax, not sure where you are drawing this conclusion from. You 
probably are overthinking this. Any content that shows what D can 
do or mentions D is a plus IMO.


Re: Vibe.d tutorial

2021-03-03 Thread aberba via Digitalmars-d-learn

On Monday, 1 March 2021 at 22:25:39 UTC, Rey Valeza wrote:
Hi, I wrote a tutorial on Vibe.d while trying to re-learn 
Vibe.d. I find that most of Kai Nacke's book need updating, so 
I wrote a tutorial while trying to re-learn it.


Here it is.

https://github.com/reyvaleza/vibed/commit/27ec3678f25d1dd414fae1390677397a7bc57721

I would be glad if you can give me some feedback so I can 
improve it.


Thanks!


Wow, that's a lot of hard work! Nice!


Re: Article: Why I use the D programming language for scripting

2021-02-02 Thread aberba via Digitalmars-d-announce

On Tuesday, 2 February 2021 at 03:53:43 UTC, Виталий Фадеев wrote:

On Sunday, 31 January 2021 at 20:36:43 UTC, aberba wrote:

[...]


If the article is about scripting, then the article will 
contain examples of scripts used in business.


[...]


Nice examples!


Re: Article: Why I use the D programming language for scripting

2021-02-01 Thread aberba via Digitalmars-d-announce

On Monday, 1 February 2021 at 11:29:02 UTC, Bastiaan Veelo wrote:
On Sunday, 31 January 2021 at 20:47:13 UTC, Steven 
Schveighoffer wrote:

On 1/31/21 3:36 PM, aberba wrote:

It's finally out!

https://opensource.com/article/21/1/d-scripting


Hm... right off I see the shebang is not the first line in the 
example. It has to be.


Please fix, Aberba, right now the examples don't work because 
of this...


-- Bastiaan.


Yes, noted. I don't have direct access to edit it myself. I have 
to wait till the editors make the changes (depending on their TZ)


I should really get someone here to proofread it next time  
Sorry about that.


Article: Why I use the D programming language for scripting

2021-01-31 Thread aberba via Digitalmars-d-announce

It's finally out!

https://opensource.com/article/21/1/d-scripting


Re: QtE5 for Qt 6

2021-01-22 Thread aberba via Digitalmars-d-announce

On Friday, 22 January 2021 at 22:13:02 UTC, aberba wrote:

On Thursday, 21 January 2021 at 18:34:03 UTC, MGW wrote:
I want to meet Qt 6 by creating QtE6. This forced me to update 
github/QtE5 to the latest stable version: widgetsXX.dll/so + 
qte5.d (qt 5.12.7). Programming is easy, compilation does not 
require Qt metacompiler (it uses a set of ready-made slots), 
works on Linux and Windows. Of course this is not full Qt, but 
a small part that I use every day in my projects.


https://github.com/MGWL/QtE5


Will be nice to see a way to set it up send build something 
like a Hello world app. There's quite often interest in using 
At in D.


I just saw some examples. Cool.


Re: QtE5 for Qt 6

2021-01-22 Thread aberba via Digitalmars-d-announce

On Thursday, 21 January 2021 at 18:34:03 UTC, MGW wrote:
I want to meet Qt 6 by creating QtE6. This forced me to update 
github/QtE5 to the latest stable version: widgetsXX.dll/so + 
qte5.d (qt 5.12.7). Programming is easy, compilation does not 
require Qt metacompiler (it uses a set of ready-made slots), 
works on Linux and Windows. Of course this is not full Qt, but 
a small part that I use every day in my projects.


https://github.com/MGWL/QtE5


Will be nice to see a way to set it up send build something like 
a Hello world app. There's quite often interest in using At in D.


Re: Why many programmers don't like GC?

2021-01-18 Thread aberba via Digitalmars-d-learn

On Monday, 18 January 2021 at 13:14:16 UTC, Arafel wrote:

On 18/1/21 13:41, Ola Fosheim Grøstad wrote:
Yes, it is natural that the current D population don't mind 
the current GC. Otherwise they would be gone... but then you 
have to factor in all the people that go through the revolving 
door and does not stay. If they stayed the eco system would be 
better. So the fact that they don't... is effecting everyone 
in a negative way (also those that har happy with the runtime).


I must be in the minority here because one of the reasons why I 
started using D was precisely because it HAS a GC with full 
support. I wouldn't even have considered it if it hadn't.


For what I usually do (non-critical server-side unattended 
processing) latency is most obviously not an issue, and I for 
me not having to worry about memory management and being able 
to focus on the task at hand is a requirement.


1). You're not a minority at all. System programming is also vast 
so having a GC (especially D's special kind of GC) is nothing 
alien in System programming. If you look out there, you'd see 
most of the very important software (for the lack of a better 
word) written uses some form of GC.


2). I'm not sure anyone really know how many people use D, stay 
with D after first encounter or leave. So we're all guessing our 
biases. And I wouldn't look at just the core language as why 
someone will move to D or not.


From my experiencing freelancing, I've come to see that a large 
portion of clients' decision stems from other things like 
familiarity and ecosystem (packages, frameworks, vendor/cloud 
support, engineering hiring pool, consultants/support 
availability, tooling, marketing/popularity/fomo/community, 
etc)... including things that usually comes from the community 
and stakeholders. For D we don't really have any measure of 
community size. Only looking at the forum can be misleading.


3). Using GC doesn't mean you're writing scripts. A significant 
amonnt of very large D code I've read (including those from long 
time users) use GC... sometimes partially. So to think or assume 
GC is hurting D is an unmeasured bias.


I'm not saying those who are looking for nogc don't really matter 
(even though I hold the opinion that one can write nogc code in D 
just fine). dplug is written in D. What else couldn't?


Also maybe the GC and other complaints (genuine or not), which 
I'm also a culprit, might actually be a contributing to people's 
first impression of D when they visit the forums. I have a 
strongly suspicious of this.


Re: Why many programmers don't like GC?

2021-01-18 Thread aberba via Digitalmars-d-learn
On Monday, 18 January 2021 at 11:55:46 UTC, Ola Fosheim Grøstad 
wrote:

On Monday, 18 January 2021 at 11:43:20 UTC, aberba wrote:
Nevertheless, GC in D isn't going anywhere. And if the 
approach for writing nogc code in D doesn't cut it, then I'm 
not what else will.


As long as that attitude prevails, D will be going nowhere as 
well.


I meant it as this. English is not my native language so pardon 
my phrasing if it doesn't sound right.



I'm not aware of an alternative way of writing D code aside what 
already comes with it by default.


If you read the Origin of D book, you would see that the GC was a 
desire thing when D was designed probably due to how useful it is 
for ... as said, 90% or so of software development. So at this 
point, fighting the GC isn't (in my opinion) the right strategy.


I should also say that I notice your point about improving GC in 
D and making it more optional as much as possible for things that 
still rely on GC...ARC, etc. 



The OP was about why programmers don't "like" GC. I've been here 
long enough to see the GC being one of the most re-occurring 
issues for discussion (probably due to new users coming in). 
There's been official posts about how D's style of GC isn't like 
that of fully managed languages, how to write nogc code in D, how 
to minimize GC, among others.


Now if none of these work for you (for some special reason), then 
the long-term strategy might be an alternative runtime and or 
std. Which isn't a good answer that thought was worth it...so I 
didn't include that.


If none of these work, then I (as in my personal opinion), don't 
know what else is available.







Re: Why many programmers don't like GC?

2021-01-18 Thread aberba via Digitalmars-d-learn
On Monday, 18 January 2021 at 07:11:20 UTC, Ola Fosheim Grostad 
wrote:

On Monday, 18 January 2021 at 01:41:35 UTC, James Blachly wrote:
Those were not aberba's words, but the author of the first 
link, in which one does find a conceptual, high level 
description of GC.


I read it, it said nothing of relevance to the D collector. 
That is not TLDR informative.


It talks how the use of GC is desired even in a game engine like 
Unreal. Several AAA title's have been built on Unreal.


Apparently you can't convince people who have made up their mind 
about GC being a bad thing for D.


Nevertheless, GC in D isn't going anywhere. And if the approach 
for writing nogc code in D doesn't cut it, then I'm not what else 
will.


Re: Why many programmers don't like GC?

2021-01-15 Thread aberba via Digitalmars-d-learn
On Friday, 15 January 2021 at 19:49:34 UTC, Ola Fosheim Grøstad 
wrote:
On Friday, 15 January 2021 at 19:37:12 UTC, Guillaume Piolat 
wrote:

A small GC heap is sufficient.
There is this blog post where there was a quantitative measure 
of the sub-1ms D GC heap size.


That's ok for a small game, but not for applications that grow 
over time or projects where the requirement spec is written 
(and continually added to) by customers. But for enthusiast 
projects, that can work.


Many open source projects (and also some commercial ones) work 
ok for small datasets, but tank when you increase the dataset. 
So "match and mix" basically means use it for prototyping, but 
do-not-rely-on-it-if-you-can-avoid-it.


Switching to ARC looks more attractive, scales better and the 
overhead is more evenly distributed. But it probably won't 
happen.


Isn't it more theoretical/imaginary/hypothetical than something 
really measured from a real-world use case? Almost all large 
software use cases I've seen used mix and match.


(BTW ARC is also another form of GC)

Unreal game engine 
https://mikelis.net/garbage-collection-in-ue4-a-high-level-overview/


Unity (of course) 
https://docs.unity3d.com/Manual/UnderstandingAutomaticMemoryManagement.html


Legends have it that almost every major software project in ANY 
system language ends up writing custom allocators and 
containers.





Re: Why many programmers don't like GC?

2021-01-15 Thread aberba via Digitalmars-d-learn

On Friday, 15 January 2021 at 21:15:29 UTC, aberba wrote:
On Friday, 15 January 2021 at 19:49:34 UTC, Ola Fosheim Grøstad 
wrote:

[...]


Isn't it more theoretical/imaginary/hypothetical than something 
really measured from a real-world use case? Almost all large 
software use cases I've seen used mix and match.


(BTW ARC is also another form of GC)

Unreal game engine 
https://mikelis.net/garbage-collection-in-ue4-a-high-level-overview/


Unity (of course) 
https://docs.unity3d.com/Manual/UnderstandingAutomaticMemoryManagement.html



[...]



TL;DR:

In summation, the garbage collection system is a robust part of 
Unreal Engine that affords C++ programmers a lot of safety from 
memory leaks, as well as convenience. With this high-level 
discussion, I was aiming to introduce the system at a 
conceptual level, and I hope I have achieved that.


Re: Say Hello to Our Two New Pull-Request/Issue Managers

2021-01-13 Thread aberba via Digitalmars-d-announce

On Wednesday, 13 January 2021 at 11:33:44 UTC, Mike Parker wrote:
I'm very, very happy that I can finally announce the news. Some 
of you may recall the job announcements I put out on the blog 
back in September [1]. Symmetry Investments offered to fund one 
full-time, or two part-time, Pull Request Manager positions, 
the goal being to improve the efficiency of our process 
(prevent pull requests from stagnating for ages, make sure the 
right people see the PRs in need of more than a simple review, 
persuade the right people to help with specific Bugzilla 
issues, etc).


[...]




Very happy about this. Congrats.


Re: Developing and running D GUI app on Android

2021-01-13 Thread aberba via Digitalmars-d-learn

On Wednesday, 13 January 2021 at 02:02:16 UTC, H. S. Teoh wrote:
On Sun, Jan 10, 2021 at 06:58:13PM +, aberba via 
Digitalmars-d-learn wrote:

[...]


First, you need a way to build an APK, and then transfer that 
to your Android device for testing.  Building an APK *can* be 
done manually (well, scripted), but I don't recommend it.  The 
simplest way is probably to install Android Studio and the 
Android SDK, and use Gradle to build your project.  Gradle 
takes care of the finicky details of how to build an APK, and 
the Android dev tools let you install to Android in debug mode 
without having to find your own way of transferring APKs.


[...]


So Adam's tool setup is pretty clear (talked to him). What 
remains is calling Java classes and interacting with the 
Android's API. I know a little bit of Java but not enough 
Android. Just the calling conversation part.


Do you have a sample of how that works?


Tutorial: Building a simple Web server with arsd CGI framework

2021-01-11 Thread aberba via Digitalmars-d-announce

https://aberba.com/2021/a-simple-web-server-with-arsd-cgi/


Developing and running D GUI app on Android

2021-01-10 Thread aberba via Digitalmars-d-learn
I'm looking to explore running a D application on Android based 
on Adams previous foundation work. However, I'm not familiar with 
the Android + D integration so I need some help.


Has any of you successfully done that? Could use a sample code or 
anything I can use to figure out how to start.


Re: Socket handle leak and active handle warning with Vibe-D

2021-01-08 Thread aberba via Digitalmars-d-learn

On Friday, 1 January 2021 at 22:07:28 UTC, Selim Ozel wrote:


[2] https://github.com/SelimOzel/vibe_noLeaks


I don't see anything abnormal in this code though. Will trying it 
later today myself.


Could you show the actual socket code causing that leak?


Re: Socket handle leak and active handle warning with Vibe-D

2021-01-08 Thread aberba via Digitalmars-d-learn

On Tuesday, 5 January 2021 at 21:12:01 UTC, Selim Ozel wrote:
On Monday, 4 January 2021 at 17:17:10 UTC, Steven Schveighoffer 
wrote:

On 1/2/21 12:52 PM, Selim Ozel wrote:



After logging into to 127.0.0.1 for a single time in my 
browser, if I do a ctrl+c it still leaks two socket handles.


With connection Windows 10:

Running .\vibe_noleaks.exe
[main() INF] Listening for requests on http://[::1]:8080/
[main() INF] Listening for requests on 
http://127.0.0.1:8080/
[main() INF] Please open http://127.0.0.1:8080/ in your 
browser.

[() INF] Received signal 2. Shutting down.
[main() INF] Stopped to listen for HTTP^ requests on 
C::1:8080

[main(
) INFC:\Software\vibe_noLeaks>] Stopped to listen for HTTP 
requests on 127.0.0.1:8080

Warning: 2 socket handles leaked at driver shutdown.
Warning: 2 socket handles leaked at driver shutdown.


This is normal. The server uses keepalive connections, so that 
in case any more requests arrive on the same connection, the 
initial connection setup does not need to be established. 
Well, at least that is what I think is happening.


If you want a few seconds (I think 5 or so), then you won't 
get these.


It would be good if vibe-d could provide a way to shut down 
any keepalive connections when the server is shutting down.


-Steve


That's interesting. I actually started to dive deeper into 
those and tried to pinpoint the lines of code that result in 
additional open sockets upon new http connections; although my 
understanding of vibe-d is a bit too low at this point to 
figure out what's exactly happening.


I think from a user perspective having something a bit 
friendlier on warning side would be helpful.


Bausshf built a wrapper around vibe.d sockets called cheetah. 
Haven't used it myself but it looks more abstracted than than 
actual vibe.d code. Can't speak of the quality since I haven't 
used it myself.


Also it's got both a server and client abstraction but only the 
server example is shown. Still not low-level though.


https://github.com/bausshf/cheetah/wiki/Simple-Socket-Server-Example


I've used the very vibe.d example you referenced in the past and 
didn't have any trouble with it. So it could possibly be a bug or 
regression.


If you've have wsl2 installed on Windows, try running on the 
Linux side too.


Do you have any
suggestions in mind towards that? I have a bit of time this 
week and I could take a stab at it.


B





Re: Simple BeamUI project won't link

2021-01-03 Thread aberba via Digitalmars-d-learn

On Saturday, 2 January 2021 at 15:48:11 UTC, Kyle Ingraham wrote:
On Friday, 18 December 2020 at 19:14:25 UTC, Daren Scot Wilson 
wrote:
So maybe beamui isn't ready for the real world.  It's a 
one-off personal tool for image processing, maybe will go up 
on Github, so I don't need anything super-solid or well 
established. OTOH, if it's too much on the WIP side with lots 
of loose ends, it might be more work than my free time allows.


At least, beamui appears to be more workable than dlangui 
which seems to have fallen away.


Did you find a GUI library to work with? I'm in the same boat 
as you working on a tool for image processing in my free time.


I always recommend gtkd. Its pretty good. See gtkdcoding.com for 
examples.


Re: Socket handle leak and active handle warning with Vibe-D

2021-01-03 Thread aberba via Digitalmars-d-learn

On Friday, 1 January 2021 at 22:07:28 UTC, Selim Ozel wrote:
I created the simplest possible example as explained by the 
Vibe-D community in [1]. The exact source code of what I run is 
in [2].


On Windows I get a socket handle leak warning on shutdown with 
crtl+c from terminal after running the executable.



[...]


On Ubuntu 20.04 I get leaking drivers warning with the same 
process.

   [...]


I really don't know what this is all about but it is at the 
core of my Vibe-D development. So any pointers you might have 
would be very helpful to me.


Thanks in advance.

S

[1] 
https://vibed.org/blog/posts/a-scalable-chat-room-service-in-d

[2] https://github.com/SelimOzel/vibe_noLeaks


Add this to your dub.json file to fix it

"versions": [ "VibeHighEventPriority" ]


This issue should be fixed in next vibe.d release


Re: Our community seems to have grown, so many people are joining the Facebook group

2020-12-29 Thread aberba via Digitalmars-d-announce

On Monday, 28 December 2020 at 17:31:21 UTC, Murilo wrote:
In the past 2 weeks we went from 225 to 240 members in our 
Facebook 
group(https://www.facebook.com/groups/ProgrammingInDlang), an 
average of a person per day. First it was an average of a 
person per month or less. I wonder if someone has advertised 
the group or the world is finally embracing Dlang now.


In 2018 I didn't find a single Dlang Facebook active group, 
there were 1 or 2 very old groups with no members. So I created 
one and I've been working hard to make it official and big, it 
worked! At first I added my friends list to give it number but 
then, as people joined it, I removed all of my friends and left 
only people who joined voluntarily, there were only 150, over 
time it grew to 225 and now we are getting close to 250.


At first there was only a post per week, all posted by me, now 
I don't need to post something every week because the members 
are already doing it themselves, there is regular activity 
including posts and discussions.


I'm very happy, at first the people here did not like my idea, 
they thought a Facebook group was unnecessary, but what is the 
biggest social media in the world? Facebook! So that's is the 
best way to communicate with the world and advertise Dlang.


Cheers.



You're doing amazing job BTW. I've not personally been very 
active on Facebook lately, but I'm sure you know I do post in the 
group too. Also it doesn't have to be official. The discord 
server also isn't official yet very active as well.


We might not all have the same REALITY as to which platforms are 
important/appropriate, but I personally live in a reality where 
lots of developers are also very active on Facebook. I've also 
been nurturing a D WhatsApp group here cus WhatsApp is very 
common for smaller dev communities here. Even though its 
currently max 250ish people, its still one of the most active 
means. Yeah WhatsApp groups.


Whatever propels D.

So I'm sure the Facebook group will appeal to a certain audience 
who use Facebook. I've been a part of all sorts of Facebook 
groups related to my stack and I've come to the understand it's 
what certain people even prefer.





Re: Printing shortest decimal form of floating point number with Mir

2020-12-23 Thread aberba via Digitalmars-d-announce
On Wednesday, 23 December 2020 at 17:22:28 UTC, Ola Fosheim 
Grøstad wrote:

On Wednesday, 23 December 2020 at 17:08:26 UTC, 9il wrote:


C++ templates can be resolved, at least at the level Mir needs 
this. So, it is a bug in my opinion. But it was said the DIP 
is required. I can't write DIP well and was very happy that 
Stefanos wrote the DIP and even the druft.


Yes, if something is perceived as bug it becomes a burden to 
remember that it is isn't. Not sure why anyone resist this 
improvement. Hm, he seems to be a compiler consultant now, but 
no longer interested in D?


Maybe the DIP should have pushed harder on what other languages 
support (might be viewed as a stronger political argument).



That would take someone

1) who really really cares and has lot's of time on their hands
2) is paid to do that job so they're motivated to keep pushing 
politically (Without clear communication)

3) really needs to get that fixed for the job

None of which seems to me we're making it easy for people without 
time of their hands to make contribution. Spending hours-days 
writing a DIP or pull request that doesn't get the attention it 
deserves can be very demoralizing (undervalued). Even anything as 
simple as an idea, especially (or at least) coming from a very 
technical person, deserves some attention and clear 
feedback/communication. I've seen people quit their job after 
such experiences...and that's a PAID job.


Looks to me like running away from responsibility or like I've 
been saying, a missing hand needed to bridge that gap.




Re: Printing shortest decimal form of floating point number with Mir

2020-12-23 Thread aberba via Digitalmars-d-announce

On Wednesday, 23 December 2020 at 16:25:58 UTC, 9il wrote:
On Wednesday, 23 December 2020 at 15:37:45 UTC, Ola Fosheim 
Grøstad wrote:

On Wednesday, 23 December 2020 at 03:06:51 UTC, 9il wrote:
You, Andrey, and Atila don't care about language features 
that have been requested for Mir or even more: rejecting DIP 
draft + DMD partial implementation for no real reason.


Out of curiosity, which language features would improve Mir?


1.
Alias template function parameter resolution
https://github.com/dlang/dmd/pull/9778

As a result D and Mir lost Stefanos Baziotis. That is terrible, 
hi is very talented.


Read through the thread. That sucks.





Re: Getting started with graphqld

2020-12-23 Thread aberba via Digitalmars-d-learn

On Wednesday, 23 December 2020 at 08:33:21 UTC, Trustee wrote:

On Tuesday, 22 December 2020 at 23:49:12 UTC, aberba wrote:

On Friday, 18 December 2020 at 03:36:05 UTC, Trustee wrote:

[...]


Heres's a demo I put together 
https://github.com/aberba/graphqld-demo


A minimal example with only the essential APIs


Thank you for this. Between this and the test code I should 
have enough to get going with.


I did also begin working through the test code and it was 
beginning to make sense. Being pushed for time though, I did 
spin up a Prisma 2 based gateway server. This time with the 
intention to build out a D version in parallel as I learn the 
package.


This should speed things along.

I will keep you posted on any developments and I'll be sure to 
get in touch if I have any questions.


Thanks again.


I keep hearing about Prisma too... gotta learn myself.


Re: Getting started with graphqld

2020-12-22 Thread aberba via Digitalmars-d-learn

On Friday, 18 December 2020 at 03:36:05 UTC, Trustee wrote:

On Thursday, 17 December 2020 at 14:49:42 UTC, evilrat wrote:

On Tuesday, 15 December 2020 at 16:25:29 UTC, Trustee wrote:


connect a basic vibe-d app to a graphql backend.



umm, what?
Did you mean write graphql backend using vibe.d?


Vibe-d web app -> Vibe-d/GraphQL gateway server (a la Prisma 1) 
-> Vibe-d/GraphQL API server -> Data.


That's why I'm more interested in the workings of the package 
than a "How-To get a basic vibe-d/graphql server. I want to 
know which pieces are available OOTB to be put together to 
create the above, and which pieces need to be created.


Heres's a demo I put together 
https://github.com/aberba/graphqld-demo


A minimal example with only the essential APIs


Re: Getting started with graphqld

2020-12-20 Thread aberba via Digitalmars-d-learn

On Friday, 18 December 2020 at 02:46:32 UTC, Trustee wrote:

On Thursday, 17 December 2020 at 14:49:42 UTC, evilrat wrote:

On Tuesday, 15 December 2020 at 16:25:29 UTC, Trustee wrote:


connect a basic vibe-d app to a graphql backend.



umm, what?
Did you mean write graphql backend using vibe.d?


Yes. But more so, I want to learn the ins and outs of the 
graphqld package. What's contained, what isn't (in terms of 
what functionality available and/or possible - e.g. client 
gen???, xSQL gen), what to build to add to 
complement/contribute to the package. The first phase, docs.


I have already begun working through the code and it's 
beginning to make sense.


To be fair it's more about my fluency in D than the package 
itself. I haven't been coding for a while so it gets kinda 
rusty.
I'm also familiar with GraphQL in Node.js. The issue I find with 
graphqld package is their selection of terminologies (+ how the 
code is written). The code is also a test so it uses all the 
features of the package and not necessarily the essentials. So it 
will take some time to figure it out...including reading the 
original source code of the package.


My current understanding is it uses vibe.d to serve some static 
data. It does some validation of schema among other things and 
since the example meant as a development guinea pig, it uses all 
the API spread throughout the code.


I've not given it much time to filter those out myself. Will take 
a look once more after watching his DConf video about 
itsomething about all spreadsheets must die.



Any help would be appreciated though.

Hit me up in the dlang discord... @aberba



Re: Simple BeamUI project won't link

2020-12-19 Thread aberba via Digitalmars-d-learn
On Friday, 18 December 2020 at 19:15:16 UTC, Daren Scot Wilson 
wrote:
On Wednesday, 16 December 2020 at 07:45:50 UTC, Ferhat 
Kurtulmuş wrote:
On Wednesday, 16 December 2020 at 07:40:45 UTC, Ferhat 
Kurtulmuş wrote:


This may be not your issue, but I could manage it to work by 
adding this line:


subPackage "examples/myproject"

to the dub.sdl of the beamui. I simply put my project in 
examples/ folder.


And compile and run using:

dub run :myproject


The thought crossed my mind to try putting my source under 
examples/ but that's not a good way to organize a real project. 
I'd like it be under ~/projects/, naturally. What I want to 
make will involve a lot more than just a GUI.



When BeamUI is released, you wouldn't have to do that. It's still 
wip like you said.



I've been using GTKd on Windows and Linux... including CSS 
styling for getting a pretty looking UI. It works just fine and 
gtkdcoding.com is just the learning resource for getting started.




Re: Getting started with graphqld

2020-12-16 Thread aberba via Digitalmars-d-learn

On Tuesday, 15 December 2020 at 16:25:29 UTC, Trustee wrote:

Is there anyone willing to help me get started with GraphQLD.

I have some experience with graphql in node.

My D is intermediate at best but i can learn fast with guidance.

I am able to build and deploy vibe-d apps locally and on heroku.

Basically, I'm looking for someone to stand-in in lieu of the 
documentation (currently WIP) to help me connect a basic vibe-d 
app to a graphql backend.


I am willing to contribute to documentation (and produce 
premium quality video tutorials) once i am proficient using the 
package.


Thanks in advance.


I had wanted to do a written tutorial with it but since it isn't 
well documented, I've postpone it until I figure it out. It'll 
take a while to learn the API from code...and I kind of moved 
onto something else. (and I've raised this issue with D packages 
in a post I wrote)



It's quite unfortunately that folks spend months developing 
something but then don't invest few hrs to make it easy for 
others to use and contribute back.


I'm pretty sure they use it at Symmetry Investments though.


Re: Simple BeamUI project won't link

2020-12-16 Thread aberba via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 07:02:11 UTC, Daren Scot Wilson 
wrote:
Trying out the beamui GUI package, obtained by git clone from 
github.  The "basic" example builds and runs.


[...]



When you look inside the examples folders, you'll see all the 
dependencies required to get it to work.


I know because I had a similar issue and the developer gave me 
heads up.


As already mentioned, beamUI isn't ready still work in 
progress.





Re: How to unit-test a phobos module?

2020-11-27 Thread aberba via Digitalmars-d-learn

On Friday, 27 November 2020 at 04:08:33 UTC, Q. Schroll wrote:
On Thursday, 26 November 2020 at 05:29:16 UTC, Mike Parker 
wrote:


Tomorrow, I'll try setting up a dual boot and give it a shot 
there. (Not the dub experience  but following 
https://wiki.dlang.org/Building_under_Posix)


Have you heard about WSL...WSL2? You don't need dual boot 
anymore. Read https://docs.microsoft.com/en-us/windows/wsl/about


Re: Automatic update system

2020-11-27 Thread aberba via Digitalmars-d-learn

On Friday, 27 November 2020 at 20:00:22 UTC, aberba wrote:

On Thursday, 26 November 2020 at 12:13:59 UTC, vnr wrote:

On Linux, both Flatpak and Snap all provide suck functionality.

Such* was what I meant .

On Flatpak, it's not really a pure auto-update...but users get to 
up update from the store. Cus some folks are skeptical about 
auto-updates.


1. 
https://docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-packaging-dot-net#:~:text=%20Setup%20the%20Windows%20Application%20Packaging%20Project%20in,make%20sure%20to%20set%20the%20Minimum...%20More%20





Re: Automatic update system

2020-11-27 Thread aberba via Digitalmars-d-learn

On Thursday, 26 November 2020 at 12:13:59 UTC, vnr wrote:

Hello,

I have a program written in D which is open-source on GitHub.

I would appreciate it if, when I release a new version, users 
would be notified by the program and that it offers an 
automatic update, i.e. the user doesn't have to reinstall the 
whole repository himself, but that it is updated automatically.


I haven't found any packages that directly meet my needs, but 
in the meantime I imagine that I will have to use the GitHub 
API, as well as Curl to make such a system.


Do you have any resources or suggestions as to how I could 
implement this? Thank you!


Auto-updates of an installed app (.ie. if that's what you want) 
is done from the app's installation side of things... App Store 
(with a few exceptions of course). On Windows, Microsoft's new 
packaging stack supports that [1]. You can even set it up with 
your CI/CD pipelines...e.g. GitHub Actions.


On Linux, both Flatpak and Snap all provide suck functionality.

1. 
https://docs.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-packaging-dot-net#:~:text=%20Setup%20the%20Windows%20Application%20Packaging%20Project%20in,make%20sure%20to%20set%20the%20Minimum...%20More%20


Re: DConf Online 2020 was a big success!

2020-11-24 Thread aberba via Digitalmars-d-announce

On Monday, 23 November 2020 at 07:39:58 UTC, Walter Bright wrote:
I enjoyed #DConfOnline very much, though I miss seeing everyone 
in person.


[...]


D rox
The community rox
The Conf rox

Thanks everyone for making it a success


Re: Reflection on the book D web development.

2020-11-21 Thread aberba via Digitalmars-d-learn

On Friday, 20 November 2020 at 19:12:38 UTC, Alaindevos wrote:

I bought the book "D Web Development".
I understand only 20% of the book,the other 80% is way above my 
head.
Compare, I own a book on flask development, and I understand 
100% of it.
Which means I can use dlang for anything except QT and serious 
web development ...


How would you like this to be improved? I'm personally interested 
in making vibe.d more accessible.





Re: D + raylib = BlobEditor

2020-11-03 Thread aberba via Digitalmars-d-announce

On Monday, 2 November 2020 at 19:02:35 UTC, Andrea Fontana wrote:

Hello.

I've just published a small toy/demo project.

I use D and raylib to create and render a blob in real time.

Here a video: https://www.youtube.com/watch?v=RIVDdXV6D-A
Here the source: https://github.com/trikko/BlobEditor

It runs fine on my 7yo laptop.

Andrea


Pretty neat


Re: bindbc-sfml 0.1.0

2020-11-03 Thread aberba via Digitalmars-d-announce

On Monday, 2 November 2020 at 11:01:53 UTC, Mike Parker wrote:
I've finally gotten around to finishing up the port of 
DerelictSFML2 to BindBC:


http://bindbc-sfml.dub.pm/

Unlike the Derelict package, it supports every release of CSFML 
from 2.0 to 2.5. It's untested beyond compiling and loading, so 
I appreciate any bug reports anyone files.


One issue I encountered myself is this one when loading the 
CSFML Network library:


https://github.com/BindBC/bindbc-sfml/issues/1

It's got me stumped, but I have no more time to put toward it 
at the moment.


For those not in the know, SFML is a C++ library designed for 
game and multimedia development. CSFML is the set of official C 
bindings.


https://www.sfml-dev.org/
https://www.sfml-dev.org/download/csfml/


I have personally requested this for the past 2 yrs and I can't 
thank you enough for doing this.





Re: Print int[string] sorted by Value

2020-10-28 Thread aberba via Digitalmars-d-learn

On Wednesday, 28 October 2020 at 15:15:40 UTC, Paul wrote:

per the D sample wc2.d
size_t[string] dictionary;  <-is printed by...
.
foreach (word1; dictionary.keys.sort) writef etc

I want to print the dictionary sorted by value not key.  I can 
write an algorithm but is there a library method(s) I can use 
to iterate through the array sorted by decreasing values?


Thanks for your time.


Have you tries .values() function? dictionary.values.sort()


Re: webkit2gtkd 0.0.3 - WebKit2 bindings for GtkD

2020-10-26 Thread aberba via Digitalmars-d-announce

On Monday, 26 October 2020 at 15:28:56 UTC, Streaksu wrote:
I found myself recently for a project of mine in the need of 
bindings for the amazing Webkit2GTK library for D, using GtkD 
for ease of use, and now that they are working, sure someone 
can also find them useful!


[...]


Would be nice to see a sample usage in rhe read me.


Re: mysql-native Help required

2020-10-23 Thread aberba via Digitalmars-d-learn
On Thursday, 22 October 2020 at 18:43:40 UTC, Steven 
Schveighoffer wrote:

On 10/22/20 11:00 AM, Vino wrote:

[...]


Different error:

 Row[] data = conn.query("SELECT * FROM hostlog").array;

This is trying to call mysql-native's UFCS query function on 
Connections, which isn't valid. You need to call it on 
conn.conn.


But there's no access to the private Connection conn inside the 
Connections class. I'm not sure what the class is for anyway, 
so it's hard for me to suggest a proper alternative. Are you 
just trying to encapsulate the connection string? I'd suggest 
instead of a whole class, just a factory function:


Connection getConnection()
{
   return new Connection("...");
}

-Steve


Was about to say that. Part of why I think some people hate 
OOP...due to misuse.


All my MySQL projects have this getConnection() function.


Re: LDC 1.24.0-beta1

2020-10-23 Thread aberba via Digitalmars-d-announce

On Friday, 23 October 2020 at 18:01:19 UTC, Kagamin wrote:

On Tuesday, 20 October 2020 at 20:09:58 UTC, aberba wrote:
Supposing I'm new to D, I have previous experience with 
LLVM-based compilers so I prefer to use LDC. How am I supposed 
to know what to do? Where is the information on how to get it 
on my system through visualD installer?


The LDC experience needs some improvement here.


Supposedly they will want an IDE with everything included in 
one installer, like Visual Studio, and that's what VisualD 
installer apparently does.


Not saying Kinke SHOULD do it. Was rather disagreeing with the 
idea that "developers" don't use installers. And that's a 
shortcoming with the LDC project...no straightforward way to set 
it up on Windows using an installer. If visuald supports LDC, why 
not point people to it.


LDC at its current state is a small fraction of DMD, why? 
Convenience. That's the core difference. And convenience sells.


And this is only a Windows problem ( started using Windows few 
weeks ago and now seeing devs don't provide an installer).


Now someone is going to tell me as always (I think its already 
said) to go do it myself. I don't really see it as a priority for 
me ATM as I know how to do without an installer. But just know 
that all successful languages have Windows installers I've found 
the need to use or try. Those that don't are niche and not ready 
for mass adoption simple because it easier to use something else 
that hacking your way out of a first impression.


Of course we have DMD.

Beginners, if you want an LDC installer then "Go do it yourself". 
I wouldn't consider that a good message.


Re: LDC 1.24.0-beta1

2020-10-20 Thread aberba via Digitalmars-d-announce

On Tuesday, 20 October 2020 at 17:36:11 UTC, kinke wrote:

On Tuesday, 20 October 2020 at 16:08:47 UTC, aberba wrote:
It's an option but doesn't fill the need for an installer. Not 
sure why its hasn't been done.


See https://github.com/ldc-developers/ldc/issues/1754.


From the discussions, it seems you still don't see the value of 
an installer...backing it with the idea that LDC is for 
"developers". I'm a developer myself and I use installers all the 
time when on Windows...there are very few people I personally 
know who would go for an archive file to set it up themselves.


So not everyone is like you. The reason why I personally go for 
DMD over LDC is convenience (especially when introducing D to 
newbies)...even though LDC is more optimized for performance.


Unless what you guys are doing is an artificial barrier to get 
others to not use it.





Re: LDC 1.24.0-beta1

2020-10-20 Thread aberba via Digitalmars-d-announce

On Tuesday, 20 October 2020 at 17:36:11 UTC, kinke wrote:

On Tuesday, 20 October 2020 at 16:08:47 UTC, aberba wrote:
It's an option but doesn't fill the need for an installer. Not 
sure why its hasn't been done.


See https://github.com/ldc-developers/ldc/issues/1754. I 
personally never download the DMD installers, only the .7z. I 
also don't use a global PATH set up to point to a particular 
LDC installation. I expect the vast majority of Windows *devs* 
to prefer a simple download over some installer. Those 
wanting to click through setup steps can use the VisualD 
installer with bundled LDC.


Supposing I'm new to D, I have previous experience with 
LLVM-based compilers so I prefer to use LDC. How am I supposed to 
know what to do? Where is the information on how to get it on my 
system through visualD installer?


The LDC experience needs some improvement here.


Re: LDC 1.24.0-beta1

2020-10-20 Thread aberba via Digitalmars-d-announce

On Monday, 19 October 2020 at 20:49:14 UTC, Andre Pany wrote:

On Monday, 19 October 2020 at 18:48:11 UTC, notna wrote:

On Sunday, 18 October 2020 at 22:40:53 UTC, aberba wrote:


It would be convenient if you provided a .exe installer as 
well. Not sure what to do with the .7z file without manual 
tinkering.


use scoop for Windows package mgmt in a user context. build 
with developers in mind. for installation see:

https://scoop.sh/

simple as:
* scoop install dmd
* scoop install ldc

stay always up to date:
* scoop update
* scoop update *

... and MUCH more, see 
https://github.com/lukesampson/scoop/wiki


Also Microsoft is working on a package manager which might be 
an option in the future 
https://docs.microsoft.com/de-de/windows/package-manager/


Kind regards
Andre


Yes, I have it (winget) installed. Still, the absence of an exe 
means its more convenient to just use DMD.



Unfortunately some dev have decided to not get their stuff to 
work on DMD. DMD is an easy get-go. No thinkering needed.




Re: LDC 1.24.0-beta1

2020-10-20 Thread aberba via Digitalmars-d-announce

On Monday, 19 October 2020 at 18:48:11 UTC, notna wrote:

On Sunday, 18 October 2020 at 22:40:53 UTC, aberba wrote:


It would be convenient if you provided a .exe installer as 
well. Not sure what to do with the .7z file without manual 
tinkering.


use scoop for Windows package mgmt in a user context. build 
with developers in mind. for installation see:

https://scoop.sh/

simple as:
* scoop install dmd
* scoop install ldc

stay always up to date:
* scoop update
* scoop update *

... and MUCH more, see https://github.com/lukesampson/scoop/wiki


It's an option but doesn't fill the need for an installer. Not 
sure why its hasn't been done.


Re: LDC 1.24.0-beta1

2020-10-18 Thread aberba via Digitalmars-d-announce

On Sunday, 18 October 2020 at 22:47:17 UTC, Adam D. Ruppe wrote:

On Sunday, 18 October 2020 at 22:40:53 UTC, aberba wrote:

Not sure what to do with the .7z file without manual tinkering.


You can simply unzip it and use it directly.

That's the best way to use most D compilers actually, then any 
versions can live side by side without affecting each other.


It's what I did and added to my system path...but that's if you 
know what you're doing. An installer just like dmd etc is what 
newbies are used to.


Re: LDC 1.24.0-beta1

2020-10-18 Thread aberba via Digitalmars-d-announce

On Thursday, 1 October 2020 at 18:04:35 UTC, kinke wrote:

Glad to announce the first beta for LDC 1.24:

- Based on D 2.094.0+.
- Support for LLVM 11.
  The prebuilt packages use v11.0.0-rc4+, and the x86 packages 
newly include the LLVM backend for AMD GPUs.


Full release log and downloads: 
https://github.com/ldc-developers/ldc/releases/tag/v1.24.0-beta1


Please help test, and thanks to all contributors & sponsors!


It would be convenient if you provided a .exe installer as well. 
Not sure what to do with the .7z file without manual tinkering.


IRe: GtkD CRUD Application

2020-10-17 Thread aberba via Digitalmars-d-learn

On Saturday, 17 October 2020 at 14:53:35 UTC, Alaindevos wrote:

I've written the beginning but dont know how to end.
What is the way to add functionality for the add,edit,delete 
button ?

//==
import gtk.Button;
import gtk.Box;
import gtk.Label;
import gtk.Entry;
import gtk.Grid;
import gtk.Main;
import gtk.MainWindow;
import gtk.Widget;
import gdk.Event: Event;
import std.array: assocArray;
import std.conv: to;
import std.format : format;
import std.range: iota, retro, drop, zip;
import std.stdio: writeln;

[...]




I haven't used GTK in d myself in a long time. But gtkdcoding.com 
is s great place to see some code. You might want to start from 
the first post


Re: vibe.d / experience / feedback

2020-10-17 Thread aberba via Digitalmars-d-learn

On Wednesday, 14 October 2020 at 15:11:29 UTC, Alaindevos wrote:
Is there an example just more functional then skeleton http 
server ?

Sending data to the server and back .


If you're having vibe.d trouble and can't get a quick response, 
jump in the discord. We're there to help?


Re: How do I use translation module in vibe.d?

2020-10-17 Thread aberba via Digitalmars-d-learn

On Tuesday, 13 October 2020 at 17:02:54 UTC, Jack wrote:

On Tuesday, 13 October 2020 at 08:07:17 UTC, aberba wrote:

On Friday, 9 October 2020 at 21:07:28 UTC, jack wrote:

[...]


https://www.github.com/vibe-d/vibe.d/tree/master/examples%2Fweb-i18n

There's also an example here


My dub.json file and folder structure is exactly this one, as 
the tutorial told to do yet I get the compilation error. I 
guess the library was updated but the documentation didn't


I'll have to try that. I haven't really used vibe.d translation 
myself beyond learning... and that was a long time ago.


Re: vibe.d / experience / feedback

2020-10-13 Thread aberba via Digitalmars-d-learn

On Tuesday, 13 October 2020 at 15:02:08 UTC, Alaindevos wrote:
What is weird is that rails is THE ruby application , that 
flask is the python application, and that dlang can't have 
something like that in their standard library.

An opportunity missed.
On the other hand I don't understand the interest in Java/swing 
when there is a good working gtkd which is a good working and 
beautiful framework.


What exactly do you want to do with vibe.d that it can't anyway?


Re: How do I use translation module in vibe.d?

2020-10-13 Thread aberba via Digitalmars-d-learn

On Friday, 9 October 2020 at 21:07:28 UTC, jack wrote:
Documentation[1] tells to use 
@translationModule!TranslationContext on class, like this:



@translationModule!TranslationContext
class WebInterface {
...


but it return the error:

Error: template instance 
translationModule!(TranslationContext) does not match template

 declaration translationModule(string FILENAME)


it seems that construtor was removed[2] but I can't find the 
replacement anywhere. Could someone help with that?


[1]: see "location" section: https://vibed.org/docs#Localization
[2]: https://vibed.org/api/search?q=translationModule


D dlang discord is a great place to also reach out. There's a 
dlang webdev channel.


Re: How do I use translation module in vibe.d?

2020-10-13 Thread aberba via Digitalmars-d-learn

On Friday, 9 October 2020 at 21:07:28 UTC, jack wrote:
Documentation[1] tells to use 
@translationModule!TranslationContext on class, like this:



@translationModule!TranslationContext
class WebInterface {
...


but it return the error:

Error: template instance 
translationModule!(TranslationContext) does not match template

 declaration translationModule(string FILENAME)


it seems that construtor was removed[2] but I can't find the 
replacement anywhere. Could someone help with that?


[1]: see "location" section: https://vibed.org/docs#Localization
[2]: https://vibed.org/api/search?q=translationModule


https://www.github.com/vibe-d/vibe.d/tree/master/examples%2Fweb-i18n

There's also an example here


Re: How do I use translation module in vibe.d?

2020-10-13 Thread aberba via Digitalmars-d-learn

On Friday, 9 October 2020 at 21:07:28 UTC, jack wrote:
Documentation[1] tells to use 
@translationModule!TranslationContext on class, like this:



[...]


but it return the error:


 [...]


it seems that construtor was removed[2] but I can't find the 
replacement anywhere. Could someone help with that?


[1]: see "location" section: https://vibed.org/docs#Localization
[2]: https://vibed.org/api/search?q=translationModule



Did you do this?

Using GNU gettext compatible .po translation files, it's 
possible to localize Diet templates at compile time. This just 
requires putting the translation files with the naming scheme 
..po into a path that is registered in the 
"stringImportPaths" field of the dub.json.  must be a 
language identifier of the form en_US.


Re: vibe.d / experience / feedback

2020-10-13 Thread aberba via Digitalmars-d-learn
On Saturday, 3 October 2020 at 11:31:27 UTC, Robert M. Münch 
wrote:
On 3 Oct 2020 at 13:14:57 CEST, "0xEAB"  
wrote:



On Saturday, 3 October 2020 at 07:54:58 UTC, Martin wrote:

 On Friday, 2 October 2020 at 09:46:09 UTC, Denis Feklushkin
 wrote:

 Because standard implementation worse?


 What do you mean with "worse"?


It's said to be pretty slow…


Well, then it should be fixed... it doesn't make sense to 
spread N version because everyone things, A or B is not fitting 
for such a code framework.


And, this argument sounds like pre-mature optimization. Who has 
a real life use-case where the std lib JSON thing is too slow? 
By how much?



The community discord is a great place to get help BTW. Wherever 
issue it is, I'm sure you'll find solution there.




Re: vibe.d / experience / feedback

2020-10-13 Thread aberba via Digitalmars-d-learn

On Monday, 12 October 2020 at 11:06:55 UTC, Robert M. Münch wrote:
On 11 Oct 2020 at 16:46:13 CEST, "Ola Fosheim Grøstad" 
 wrote:



Ada, Java, Eiffel are supposed to.


Yes... beside Java, the other two are already in the exotic 
department...


I'm not sure if Go is a success in that department either. I 
suspect it tanks when programs get large.


Go seems to be kept as simple as possible, even if you have to 
write more code. Which is, in the long run, the cheaper and 
smaller burden. No tricks, no surprises... that has a lot of 
merits.


Aside all the issues with the D ecosystem... which requires 
writing certain stuff yourself. And things like vibe.d not well 
documented, here's one thing that D gives that I don't get 
anywhere else.


D is a great language that is capable of solving any problem 
easier than what it'll take to do in equivalent languages.


D's ecosystem is not currently where I would want it to be... 
simply not enough dub packages and alternatives.


Vibe.d for instance is great but it's currently moving at slow 
pace because Sonke isn't able to work on it as much as he used 
to. Personally I think it should just focus on the core base and 
let others extend on it.


But it's only a matter of time. Certain things are very doable in 
vibe.d but I guess there's not enough blog posts on vibe.d.



D is a language you learn once and use every. Just hope the 
ecosystem gets better to meet business needs... getting things 
done.




Re: mir-stat

2020-10-13 Thread aberba via Digitalmars-d-announce

On Monday, 12 October 2020 at 00:43:51 UTC, jmh530 wrote:

On Sunday, 11 October 2020 at 17:35:26 UTC, 9il wrote:

[snip]


I can't speak to the technical differences between the two. My 
understanding is that MIT is more permissive than Boost, 


I make all my stuff Boost so that anyone can do whatever they 
want with the code. So I'm hoe its not that permissive.


Re: question on dub and postgresql

2020-10-07 Thread aberba via Digitalmars-d-learn

On Monday, 5 October 2020 at 09:05:16 UTC, Alaindevos wrote:

On Monday, 5 October 2020 at 08:54:39 UTC, Daniel Kozak wrote:
On Mon, Oct 5, 2020 at 10:25 AM Alaindevos via 
Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote:



[...]


Yes and no. Dub is Dlang dependency solution but it is not 
installer as pip is




[...]


Yes if you want to use any of dub packages you need to add it 
as a dependency to your dub.json (dub.sdl)


A name dependency solution is at least vage.
How do I install ,
https://github.com/denizzzka/dpq2
on unix so in the code i write the .d files of that library and 
after compilation linked to the libary shared objects. For that 
shared object must be installed. How ?


It seems the D ecosystem is not immediately obvious to some 
people. Dub, compilers, and IDEs are recurring issues.


Re: [Release] Authomata: a two-factor authentication gui app for Gnu/Linux

2020-10-05 Thread aberba via Digitalmars-d-announce

On Sunday, 4 October 2020 at 19:07:35 UTC, Alireza SN wrote:
This weekend i had some free time and wrote this GtkD app for 
two-factor authentication (yes i know there are alternatives 
but it's a cool little project).


It still lacks a lot of functionality like 
edit/delete/import/export but the config file 
(~/.config/Authomata/config.json) is a json array so it's 
pretty easy make a backup or edit manually.


Give it a try:
https://github.com/TheWeirdDev/Authomata

I will add more features in the upcoming weekends :)


Nice. Will you publish it on flathub or snap store eventually?


Re: vibe.d / experience / feedback

2020-10-01 Thread aberba via Digitalmars-d-learn
On Thursday, 1 October 2020 at 06:32:23 UTC, Robert M. Münch 
wrote:
Hi, we are currently using vibe.d for a prototype and I want to 
post some experiences. I know one shouldn't only address the 
problems but provide some solutions.


[...]



I've been in a similar position once... when it slows you down. 
Vibe could stay simple and break things down into separate 
packages.


The docs is also a major issue. But try filling issues like these 
on the repo.


Re: vibe.de multiple ports.

2020-09-30 Thread aberba via Digitalmars-d-learn

On Wednesday, 30 September 2020 at 12:38:10 UTC, seany wrote:
On Wednesday, 30 September 2020 at 12:29:06 UTC, Daniel Kozak 
wrote:
Dne st 30. 9. 2020 13:25 uživatel seany via 
Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> 
napsal:



Hello

I am trying to use this example for a iot application: 
https://aberba.com/2018/using-vibe-d-web-interface/


The code i use is:

ushort port   =   5504;

void main(char[][] args)
{

 auto router = new URLRouter;
 router.post("/archive", );
 router.get("/archive", );

 auto settings = new HTTPServerSettings;
 settings.port = port;
 settings.bindAddresses = ["::1", "0.0.0.0"];
 listenHTTP(settings, router);

 runApplication();
}


This is fine. But now that we have ~ 100 IoT devices in the 
field, I would like to assign each a new port.




Why? I do not see any reason for that.


to separate the messages from the IoT responses quickly and 
forward them to different programs, and to have the capability 
in hand, so that when later i have an idea to exploit the 
capability, I can also do it.


What you are doing, if I understand you well, is a way of scaling 
the server to handle high amount of traffic.


If that's right, then I'm not sure how the number of PORT is the 
issue. Irrespective of the port, the server resources remains the 
same.


And if that's the case, then you might need a load balancer (or 
use nginx or any of the options I've used in my projects). In 
that case, you run multiple versions of the server in stateless 
environments... scaled up or down on demand.




Been a long while since I wrote some vibe.d tutorials though :)


Re: DIP 1030-- Named Arguments--Formal Assessment

2020-09-21 Thread aberba via Digitalmars-d-announce
On Monday, 21 September 2020 at 09:07:39 UTC, Martin Tschierschke 
wrote:
On Thursday, 17 September 2020 at 12:59:05 UTC, Mike Parker 
wrote:
On Thursday, 17 September 2020 at 12:58:06 UTC, Mike Parker 
wrote:

DIP 1030, "Named Arguments", has been accepted.



https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1030.md


I am happy with that, too. So what is the estimated time frame 
for getting it in dmd?


Good question :)


Re: DDoc generation

2020-09-21 Thread aberba via Digitalmars-d-learn
On Saturday, 19 September 2020 at 11:39:45 UTC, Jacob Carlborg 
wrote:
On Saturday, 19 September 2020 at 07:43:24 UTC, Russel Winder 
wrote:


Doesn't that then make the whole DDoc system fairly useless, 
despite it's use in Phobos?


Yes.  The problem is that most things in D are compared with C 
or C++. People are praising that the built-in support for unit 
tests and Ddoc are the best things that have happened since 
sliced bread. But if you compare with C or C++ the bar isn't 
very high.


--
/Jacob Carlborg


+1.

Couldn't agree more.


Re: Building LDC runtime for a microcontroller

2020-09-19 Thread aberba via Digitalmars-d-learn

On Friday, 18 September 2020 at 07:44:50 UTC, Dylan Graham wrote:

On Monday, 7 September 2020 at 19:12:59 UTC, aberba wrote:

[...]


I use D in an automotive environment (it controls parts of the 
powertrain, so yeah there are cars running around on D) on 
various types of ARM Cortex M CPUs, I think this will be the 
best way to extend D to those platforms.


Wow. Happy to hear this.

Do you attend our monthly D online meetups?



The existing runtime is PC-oriented. Embedded stuff doesn't 
need a GC or some of the more advanced features, but having 
things like classes, interfaces, dynamic arrays would make the 
development workload a lot easier.

+1




A lot of embedded stuff is done with RTOSs now that provide 
memory management and threading support, so having a flexible 
lightweight runtime with a generic backend (mem allocation, 
threads) that I can hook to the RTOS' libraries would be great.


I think Ali was also working on or at least talked about that OS 
(if I remember correctly) at Dconf, right?


Re: vibe.d: How to get the conent of a file upload ?

2020-09-19 Thread aberba via Digitalmars-d-learn

On Saturday, 19 September 2020 at 20:17:06 UTC, aberba wrote:

On Friday, 18 September 2020 at 22:31:09 UTC, mw wrote:

On Friday, 18 September 2020 at 00:07:12 UTC, wjoe wrote:

Are there other frameworks besides vibe that can do what I 
want?


Personally I use vibe.d for basic side projects. Looking to use 
it more going forward. But that's how I see it.


This is my personal collection of D web development packages. Let 
me know if I'm missing something.


https://gist.github.com/aberba/dcaf9102b35205080ad99a2af2c21142



Re: vibe.d: How to get the conent of a file upload ?

2020-09-19 Thread aberba via Digitalmars-d-learn

On Friday, 18 September 2020 at 22:31:09 UTC, mw wrote:

On Friday, 18 September 2020 at 00:07:12 UTC, wjoe wrote:

Are there other frameworks besides vibe that can do what I 
want?


Just FYI, there is also:

https://code.dlang.org/packages/hunt-framework


I never used myself, you need to investigate.


Yeah, I'm aware of hunt too. Its like laravel in php whilst 
vibe.d feels more like express in nodejs. Infact I believe Sonke 
wrote vibe.d after using express or similar framework by design.



And yes, almost all frameworks work in a certain way. Arsd cgi.d 
might be what you want if you want to it your way as its more 
low-level interface-wise.


I personally (and many others in the industry... judging by 
popularity of express (node.js) and the plentiful third-party 
libraries,..do prefer the router.get() design. Also having 
everything abstracted in a convenient and consistent way...is 
very desirable. vibe.d's web interface API is something I've 
always praised and thanks to how powerful D is compare to say 
JavaScript. Diet templates is also an example.


However that power is not tapped in enough (yet) to favour using 
D conveniently over node (js). And web developers are interested 
in getting things done (at least my kind of web devs) rather than 
getting it our way...or squeezing every bit of efficiency out of 
it. Part of why v8 is fast by default (for us).


Unike express (which is a thing layer with interface for 
third-parties to hook in and extend with libs), vibe.d became a 
monolith with everything included... making it harder to maintain 
and extend in other ways. Plus too much hard-coding by default 
currently. Unfortunately Sonke doesn't work on it like he used 
to...and its quite an huge accomplishment...the work he's done 
for D.



I wish vibe.d could be positioned and sponsored officially or by 
community cus its the killer app.


Staying lean and being extensible will open up for more 
innovation around it. Eg. a form handler for files library that 
works like how Ikod suggested...a customizable stream.



Unless you're doing usual routing and database things, using 
vibe.d for a full stack projects can lead to a dead end unless 
you're positioned to write your own stuff to supplement. Of 
course its only a matter of time before this change for the good.


Personally I use vibe.d for basic side projects. Looking to use 
it more going forward. But that's how I see it.


Re: vibe.d: How to get the conent of a file upload ?

2020-09-18 Thread aberba via Digitalmars-d-learn

On Friday, 18 September 2020 at 00:07:12 UTC, wjoe wrote:
On Thursday, 17 September 2020 at 22:33:46 UTC, Steven 
Schveighoffer wrote:

On 9/17/20 6:13 PM, aberba wrote:
On Thursday, 17 September 2020 at 21:57:37 UTC, Steven 
Schveighoffer wrote:

On 9/17/20 1:08 PM, wjoe wrote:

[...]


the `files` property actually does the processing only when 
you call it.


If you access the `bodyReader` property directly, you can 
process that data yourself. You can even register a web 
interface function with an `InputStream` parameter type, and 
it will be bound to the body data.


I'm not sure I understand how to do this and parser the files 
in memory.


So an HTTP request with form data will come in with the 
headers parsed, but the data is still on the network stream.


The first time you access `files`, it processes the stream 
data, and splits it into form data and file data, saves the 
files, and then gives you back the file dictionary so you can 
use them.


If instead, you access `bodyReader`, YOU get to process the 
form data and file data.




I've done this with my REST interface, though that's not 
form data.


That's not a great API, though. I would love to see vibe.d 
allow a direct call to vibe.inet.webform.parseFormData with 
a specific handler for files and form data.
Can we file an issue for this? Because I'm very interested in 
having this resolved


You can always file an issue! 
https://github.com/vibe-d/vibe.d/issues


There may already be one in there.

There's potential to results in out of memory condition. Its 
a know issues. A complete parser (like multer in nodejs) 
allowance you to limit file size as well for error handling.


Meh, this is D :) we should be able to just process the data 
and do whatever we want with it. What I would like to see is 
vibe provide the parsing of form data, and just give me the 
data as it comes (kind of like a SAX parser). Maybe just a 
property in the HTTPServerRequest that I can set that says 
"use this callback when you get Form File data".


I've done this with my REST interface, though that's not 
form data.


Can you share your code for this?


Heh, this is not form data, it's just file data, raw on the 
stream. So I have a function like:


```
class FileRestImpl
{
@path(":cat/:id/:uuid/upload")
@getAuth
void postUpload(HTTPServerResponse res, string _cat, int 
_id, string _uuid, InputStream stream, Nullable!string md5sum, 
NRMAuthInfo _authInfo)

{
...
}
}
```

You can see, I take an InputStream as a parameter -- the data 
comes in there. I just read it and save it to a file (in the 
correct location) anyway, verifying the md5sum is valid.


-Steve


Not a reply to this post in particular but to all the ones I've 
read so far.


If I understand correctly. Vibe parses the form data and writes 
all files to disk. Where to ?
Can I configure it ? I don't want libraries to just write data 
to my file systems without me setting this up. Nowhere did I 
find this behavior described in the docs.
And if not, how is data processed with a 10mb file upload 
followed by a few number fields ?
It needs to read all of the file data to get to the other data 
fields, doesn't it ?


I'm sorry this is completely counter intuitive. I can 
understand the memory/security risks and all but I have no 
intention to hack, DOS or however else disrupt my private 
server in my private network with garbage data. I just want to 
get the data in a byte[].


That's what I was trying to answer. When Steve said meh, he 
probably didn't get what I said. Probably its because of my typos.


This sort of convenience and productivity benefit is part of why 
I use Node.Js in the job when I need to get things doneand 
not D yet. There are several pieces and bits you can't write 
yourself when working on projects.


In this case you want to get the file(s) in memory...in the form 
of bytes (or buffer) and probably set a file size limit. Its all 
doable through a library but such a library doesn't exist in D 
yet. At least not that I know of.


Its why I mentioned that multer[1] in Node.Js able to do 
that...hence the advantage. Its built for the express 
framework...meaning such library can be built to work with 
vibe.d. Not everything can be built into vibe.d..and I think 
that'll even make it bloated for other uses case. Its need an 
ecosystem of third-party libraries.


In the case of the vibe.d form, data and files are handled using 
this implementation[2] so its a reference to such a form parser 
implementation...with support for a storage parameter for either 
a MemoryStore or SessionStore. Multer does it pretty cleanly.


1. Multer: https://www.npmjs.com/package/multer
2. 
https://github.com/vibe-d/vibe.d/blob/ebebfa827f568cc9bced4bec2b66edc043a8adf7/inet/vibe/inet/webform.d





Why does the lib not simply reject files that are unreasonably 
(configurable) big ?
Writing files to disk in order to then needing to copy them 
somewhere else or to read 

Re: vibe.d: How to get the conent of a file upload ?

2020-09-17 Thread aberba via Digitalmars-d-learn
On Thursday, 17 September 2020 at 21:57:37 UTC, Steven 
Schveighoffer wrote:

On 9/17/20 1:08 PM, wjoe wrote:

[...]


the `files` property actually does the processing only when you 
call it.


If you access the `bodyReader` property directly, you can 
process that data yourself. You can even register a web 
interface function with an `InputStream` parameter type, and it 
will be bound to the body data.


I'm not sure I understand how to do this and parser the files in 
memory.




I've done this with my REST interface, though that's not form 
data.


That's not a great API, though. I would love to see vibe.d 
allow a direct call to vibe.inet.webform.parseFormData with a 
specific handler for files and form data.
Can we file an issue for this? Because I'm very interested in 
having this resolved




I think you can agree that it's not feasible to store arbitrary 
sized file contents in memory. But it certainly can provide a 
mechanism to handle it as it's read.


-Steve


There's potential to results in out of memory condition. Its a 
know issues. A complete parser (like multer in nodejs) allowance 
you to limit file size as well for error handling.


I've done this with my REST interface, though that's not form 
data.


Can you share your code for this?


Re: DIP 1030-- Named Arguments--Formal Assessment

2020-09-17 Thread aberba via Digitalmars-d-announce

On Thursday, 17 September 2020 at 12:58:06 UTC, Mike Parker wrote:

DIP 1030, "Named Arguments", has been accepted.

During the assessment, Walter and Atila had a discussion 
regarding this particular criticism:


[...]


Calls for celebration... who's in?


Re: vibe.d: How to get the conent of a file upload ?

2020-09-17 Thread aberba via Digitalmars-d-learn

On Thursday, 17 September 2020 at 16:32:55 UTC, WebFreak001 wrote:

On Thursday, 17 September 2020 at 16:00:33 UTC, wjoe wrote:
I found this [1] but unfortunately the post this refers to is 
a dead link and the content, unfortunately, didn't tell me 
anything that I didn't already find in the docs.


What I can get from the form is the form fields with content, 
the field name for the file upload and the file name. But the 
file name is useless to me because I need the file content.


Where is it stored ?

[1] https://aberba.com/2017/multiple-file-upload-in-vibe-d/


hi, you can access HTTPServerRequest.files which contains the 
uploaded file.


Example in real code: 
https://github.com/WebFreak001/ImageUploader/blob/master/source/app.d#L141-L159


Documentation: https://vibed.org/api/vibe.inet.webform/FilePart

Note: the file is only downloaded from the client / stored on 
disk once you access the files or the form property, though 
this isn't documented.


I don't believe the temp file behavior is customizable as it is 
hardcoded here to write to a temporary file (which is called on 
form parsing): 
https://github.com/vibe-d/vibe.d/blob/ebebfa827f568cc9bced4bec2b66edc043a8adf7/inet/vibe/inet/webform.d#L311


However if you really wanted to (but I'd advise against it) you 
could parse the form data from the HTTPServerRequest.bodyReader 
yourself



Yeah I think what he wants is a way to write the file into an 
in-memory buffer. This is especially necessary it some 
environments where you can write to disk at all.



How that's done, even in node.js is to use a middleware for 
parsing library to parse the headers in such way. I often use 
multer (which is also based on busybody) to do that in nodejs.


Unfortunately I haven't used D to that extent to need such a 
thing... I in never hit that problem.


I wonder if using a psuedo file handler will work for the 
in-memory buffer thing.




Re: beerconf September!

2020-09-13 Thread aberba via Digitalmars-d-announce
On Saturday, 12 September 2020 at 20:56:37 UTC, Steven 
Schveighoffer wrote:
I wanted to once again give people a good notice for the next 
upcoming beerconf, happening September 26th and 27th. As usual, 
bring your favorite beverage (non alcoholic if you prefer), and 
bring your D topics to discuss with the crew. 3 months and 
running, and each one seems to be more and more fun!


This time, we will try to keep a running tally of things 
discussed, and post back here (this was something asked about 
on slack, and I think it's a good idea).


Will ping again before the call.

Cheers!

-Steve


Nice!


Re: Beta 2.094.0

2020-09-11 Thread aberba via Digitalmars-d-announce

On Friday, 11 September 2020 at 07:48:00 UTC, Martin Nowak wrote:
Glad to announce the first beta for the 2.094.0 release, ♥ to 
the 49 contributors.


This is the first release to be built with LDC on all 
platforms, so we'd welcome some more thorough beta testing.


http://dlang.org/download.html#dmd_beta
http://dlang.org/changelog/2.094.0.html

As usual please report any bugs at
https://issues.dlang.org

-Martin


Markdown 


Re: DConf Online 2020...

2020-09-09 Thread aberba via Digitalmars-d-announce

On Wednesday, 9 September 2020 at 13:02:52 UTC, Dukc wrote:

On Tuesday, 8 September 2020 at 09:17:10 UTC, Mike Parker wrote:
I was on the verge to cutting the schedule down to one day, 
but thanks to some last-minute submissions, looks like we'll 
have enough content now to stretch across two days!


Wow! A week ago you told that there was only one relatively 
late submission besides the keynotes. I thought that if all the 
other potential submissions missed the deadline, setting 
another deadline can hardly fare better. But it seems I was 
wrong. Congratulations for everyone who offered to talk!


And I'm positive there's more.


Re: D mentionned in the ARTIBA webzine for an article on Silq

2020-09-08 Thread aberba via Digitalmars-d-announce

On Tuesday, 8 September 2020 at 13:16:29 UTC, Adam D. Ruppe wrote:

On Tuesday, 8 September 2020 at 08:33:35 UTC, aberba wrote:
Now I really want to sew your D web workflow and stack in use 
at DConf Online. Don't say no!!


Yeah, I did tell the dconf people I'd do a livestream thing if 
they need me, but I was thinking about making an Asteroids 
clone or something then porting it to webassembly like I did 
with tetris so I could talk about the library etc too.


But a web site is tempting as well,...

Do it!




Re: D mentionned in the ARTIBA webzine for an article on Silq

2020-09-08 Thread aberba via Digitalmars-d-announce

On Monday, 7 September 2020 at 20:53:56 UTC, Adam D. Ruppe wrote:
On Wednesday, 2 September 2020 at 13:31:25 UTC, Adam D. Ruppe 
wrote:

I could write that in a few hours.


I went ahead and did it:

https://dwidder.arsdnet.net/

might move later but eh the basics work i think.


Awesome Adam. Now I really want to sew your D web workflow and 
stack in use at DConf Online. Don't say no!!


Re: Building LDC runtime for a microcontroller

2020-09-07 Thread aberba via Digitalmars-d-learn

On Monday, 7 September 2020 at 16:18:00 UTC, IGotD- wrote:
On Monday, 7 September 2020 at 15:23:28 UTC, Severin Teona 
wrote:

[...]


Use betterC, which is much better suited for microcontrollers 
than the full D. The disadvantage is that many great features 
are disabled in betterC.


[...]


How about an alternative runtime + standard library for embedded 
systems...with a least bare minimum. I've seen a number of 
efforts to get D to run in those environments but almost none of 
them is packaged for others to consume.


Re: D mentionned in the ARTIBA webzine for an article on Silq

2020-09-05 Thread aberba via Digitalmars-d-announce
On Saturday, 5 September 2020 at 02:15:31 UTC, Adam D. Ruppe 
wrote:

On Friday, 4 September 2020 at 17:47:39 UTC, James Lu wrote:

And there's a Facebook? Seriously?


A random user set it up and tries to push it but there's not 
much activity.
Part of it is like Facebook being too much distraction for me. 
But I go there from time to time.





And Slack?


That's more used by like dconf coordinators.


The places new people come on for chat is just the irc and the 
discord.


I personally use discord (only recently) and slack (local 
community) but there're Facebook people too.


All have their different feel and audience.


Re: DConf Online 2020 Submission Deadline Extended

2020-09-05 Thread aberba via Digitalmars-d-announce
On Saturday, 5 September 2020 at 09:50:44 UTC, FeepingCreature 
wrote:
On Saturday, 5 September 2020 at 04:01:43 UTC, Mike Parker 
wrote:

[...]


hi

okay, if I'm literally the only one that's kind of problematic, 
yeah. Let's see how it goes on Sunday.


I'd guess that ... like, either ultimately a structured online 
conference just isn't something people are interested in or 
think is useful, or the effort of recording videos poses too 
much of a roadblock. You wouldn't think that flying to London 
would be more effort than making a video, but it wouldn't 
surprise me. Or right now maybe people are keeping their ideas 
for the next in-person DConf, so if Corona keeps up we'd see 
more talks next year.


You know what, let's ask. Anyone here who considered submitting 
but didn't, would you share why not?


Adam said he doesn't know what to talk about.

Part of me is like what could one talk about that's any 
interesting .


Re: D mentionned in the ARTIBA webzine for an article on Silq

2020-09-03 Thread aberba via Digitalmars-d-announce
On Thursday, 3 September 2020 at 16:53:17 UTC, Martin 
Tschierschke wrote:

On Thursday, 3 September 2020 at 08:40:32 UTC, aberba wrote:
The slack I have no ideas how people get in. I know there's a 
number of members in there too.
I am not very active on slack, to say it polite but I may 
invite you drop me a mail:

firstn...@lastname.info


I forget to mention that I've already gotten an invite and I'm 
now in.


Thanks guys, I appreciate the help.


Re: D mentionned in the ARTIBA webzine for an article on Silq

2020-09-03 Thread aberba via Digitalmars-d-announce

On Wednesday, 2 September 2020 at 18:53:02 UTC, James Lu wrote:
On Wednesday, 2 September 2020 at 18:42:25 UTC, starcanopy 
wrote:
On Wednesday, 2 September 2020 at 13:31:25 UTC, Adam D. Ruppe 
wrote:
But what I think would be really cool though is like an 
internal twitter... no size limit but also a culture that 
there's no expectation for length and quality. Just casual 
"think out loud" or in-progress project updates that can 
split into chat.


I could write that in a few hours. then blog about it omg. but 
the hard part

isn't technical, it is just getting people to actually use it.


Mastodon instance? But if you do create an ad-hoc service, I'd 
very much use it if you didn't necessitate registration with 
an email.


I second a Mastodon instance. Would be great for short thoughts.


Currently we have discord, slack, IRC, Facebook, Official Forum 
and IRC with community members in them. I don't think there's 
shortage of places to interact with community members for 
feedback on such ideas.


I'm on the discord (ran by Wild), Facebook, IRC (rarely cus it 
takes me back) and of course the forum.


The slack I have no ideas how people get in. I know there's a 
number of members in there too.


Re: Master Thesis using D Programming language.

2020-08-25 Thread aberba via Digitalmars-d-learn

On Monday, 24 August 2020 at 19:56:49 UTC, Tariq Siddiqui wrote:

Hello everyone,

I am looking for a master thesis topic using D Programming 
language. Earlier I choose Design by Introspection, but I did 
not find enough material in academic journals. DbI total 
material which I found is DConf Andrei talk and the similar 
talk at Google campus, which starts with 50 Deutsche Mark story 
and ends with explaining PbD, DbI and other Dlang internals. No 
doubt that Andrei's discussion was great. DbI as a topic is 
excellent, but as per my university requirements, I was not 
able to find five articles in the last five years in any 
academic journal, to start the initial discussion about the 
research topic.

Academic don't know innovation. Only history :)



I am still opened with my topic, next week, I have to submit my 
draft proposal. Till now, I did not meet my dissertation 
advisor.


Metaprogramming as suggested sounds interesting upon second 
thought. On Wikipedia, only D and C++ seems to have sufficient 
implementation among mainstream languages. With D's being 
exceptionally capable.


So you might want to do something around that...and how it 
impacts software development.




I am looking for something practical and less theoretical. I 
have found some thesis done using Rust, you guys as a language 
expert can these below projects be achievable using D 
Programming language.


Yep. Its does. Metaprogramming really has a very significant 
benefit in practice. And disign by introspection is one way it 
can be used.




Re: Master Thesis using D Programming language.

2020-08-25 Thread aberba via Digitalmars-d-learn

On Tuesday, 25 August 2020 at 16:52:17 UTC, aberba wrote:

On Monday, 24 August 2020 at 19:56:49 UTC, Tariq Siddiqui wrote:
Academic don't know innovation. Only history :)


Academia*


  1   2   3   4   5   6   >