« first day (2094 days earlier)      last day (1086 days later) » 

12:00 AM
RELOAD!
[Minesweeper] Games Played: 105, Bombs Used: 49, Moves Performed: 13480, New Users: 17
RELOAD!
[rubberduck-vba/Rubberduck] 6 issue comments
 
So I hope I'll be able to finally help with something other than just a language...
But when I tried to build the project, this came up
So it's still not compatible with VS2019?
I've got Rubberduck.Parsing as a Startup Project
Holly HELL this is so much complicated (rubberduck visual studio project) then the beginner course :D So much files, projects, and non-functioning forms.... :D whyyy......
 
12:18 AM
@SonGokussj4 it should be compatible, actually..
could you get the output from the Output window instead? That contains more in-depth information
 
12:44 AM
@SonGokussj4 you need to make Rubberduck.Deployment the solution's startup project
building Rubberduck involves COM registrations that you don't need to do in a normal .net project
The deployment csproj handles it all
 
1:11 AM
 
2:06 AM
@this i'm just finishing the first section of your article (following along in Excel)... having not used UDTs before, I feel I've already learned quite a bit. The list of things that are expected about what we know/don't know hit very, very close to home, like I was partial inspiration lol
the follow-along code i've done thusfar is basically what you've done, but hopefully aligned partly with what Mat has been pushing me towards (e.g., not having a list of declarations, etc.):
Option Explicit

Public Type Person
    FirstName As String
    LastName As String
    BirthDate As String
End Type

'### Removed to move onto a more advanced lesson
'Public Sub test()
'    Dim p1 As Person
'    p1.FirstName = "John"
'    p1.LastName = "Smith"
'    p1.BirthDate = #1/1/1970#
'    Dim p2 As Person
'    p2.FirstName = "Jane"
'    p2.LastName = "Doe"
'    p2.BirthDate = #1/1/1970#
'    Debug.Print VarPtr(p1), VarPtr(p2)
'End Sub

Public Function Create(FirstName As String, LastName As String, BirthDate As String) As Person
taking a quick mental breather before moving to the next section... i only had to stop to look up 2 things: the term "codebase" to ensure i knew the intention, and partly looking at the article from my alma mater, RIT
Tom Golisano sank a lot of money into that CS building and it really shows
 
2:20 AM
 
3:11 AM
@Cyril Take it in stride. I felt the same way too when exposed to them.
Found some new friends that followed me home.
 
The second section about creating the class is definitely a bit more complex... i can follow the example, but not following "why", which i guess goes back to understanding let/get more strongly
let allows read/write, get allows read-only? am i doing that correctly?
 
@Cyril Very good! Yes it was definitely motivated by our discussions in last few weeks.
@Cyril No; Get is read only; Let is write only.
 
ahh
 
Thus to have read/write, you must have both.
 
copy
mental breather before trying section 3... btw, thanks again @this
 
3:22 AM
@Cyril That's a good feedback. I do intend to go through applied examples in the next post. That may help make it easier to see the "why".
 
trying my best to let you know how i feel i'm getting on. will keep it up as i move onto the next spot
going to get some iced creme and check on wife; catch you in a bit
 
4:10 AM
@Cyril I can't speak for @this but I'm assuming feedback like this helps ensure the articles achieve the goals he had in mind when reading them. If something isn't clear to a newcomer he can improve.
 
copy
 
5:04 AM
going to go to bed; just starting the interfaces section, and honestly... that initial description makes more sense than the previous section (in just the first few paragrphs). "i want a mask to keep people out... okay, here's some things that no one can touch"
i feel like that might be because i've asked a bit about it in here and that just makes sense... but getting to taht `Implements`part is something i need to have a fresh brain to digest. that bit has plagued me, even in reading Mat's Class-post
 
 
1 hour later…
6:08 AM
0
Q: Assign random shift with restrictions

Ricardo DiazBased on this question Thought it was a nice puzzle Main idea: How to randomly assign shifts to employees based on these restrictions: As per the O.P.: Randomly write to cells "1" or "0" Employees' total shifts in a month can't be more than 7 and less than 4 According to a few crite...

 
 
7 hours later…
1:26 PM
the #1 thing I have learned while working on these class modules is that i cannot spell the word "property"
for figure 4-1, we were supposed to name the class "IPerson", correct? i don't think that's anywhere in the text
been bugging me since it keeps changing... #1970-01-01# keeps swapping to #1/1/1970# and my system setting reflect yyyymmdd as my date. is there a way to make vba recognize the default date as ISO8601 compliant?
i can google... sorry, figured i'm just walkign through this and that keeps catching my attention
 
1:50 PM
I got through figure 4-4 and that section, trying to make heads and tails. I understand that the IPerson member does not include a procedure for FillData, so I'm getting the error... hoping the next section explains how i'm using IPerson, because the p.FillDatausing the class, not the interface, confuses me as it doesn't "look" like i'm using the interface at all... which I think relates to Implements, where I am still trying to understand that term
will continue to re-read docs.microsoft.com/en-us/office/vba/language/reference/… after this article
 
2:12 PM
Just now finished through the article... and "However, as you saw, sometimes that is simply not possible using a UDT which need public methods to provide “API” around it" in the Conclusion helped brush up a question i had earlier, where I had never used a UDT before (only UDFs)
all in all, i learned quite a bit and gained more experience in differentiating a concrete class versus interface class, even if it was just following examples.
next step for me is to fully-reread the article from start to finish to see what i've retained and what is giving issues
but will do that later on ... kids are going crazy and i don't want them watching daniel tiger all morning
 
2:54 PM
@Cyril That's a good catch. I'll make it explicit that I intended for you to make a new class module and call it IPerson
@Cyril VBIDE wants to be very US-centric so it'll always "prettify" the date literals into US format. I always write my dates the ISO way. I can appreciate that it might be distracting, though.
 
i prefer ISO; i would like VBA to recognize and utilzie ISO
the distraction was that it kept flopping to what i "do not" want
 
yeah, no way around that.
(if there's, I'd love to know that, too)
 
so back to format(datevalue,"yyyymmdd"), eh?
that's how i've circumvented previously
kids need me, back to life
 
that wouldn't be a literal/constant anymore. :\
@Cyril I left a feedback because the article doesn't make it clear that interface in VBA is simply just a class module with stubs but no code. It gives the impression that the interface is actually a different object type in VBA. It's not, though it should have been.
@Cyril Thanks for that. There is a discussion about that in the last paragraph in the section but it sounds like I need to at least alert to the fact before introducing figure 4-3 & 4-4. Will revise.
All in all, great feedbacks and thanks!
Hmm. #TIL - C++ didn't have interface as a keyword, either.. That explains a bit why VBA most likely didn't get interface as a keyword.
 
3:19 PM
@this AvalonMentions++;?
 
Not sure how that would work. If you end up importing it into the actual VBA project, it'd get prettified.
Unless we want to keep unprettyifying (or is it re-prettyifying) every time import/export happens.
 
@this FYI I'm not getting notifications for comments on your article (I can see & approve them though)
 
Really? I am, though.
May be because I'm the author.
wait, not sure if i get notified about spams, though. Only the comments that were posted.
Since I didn't have to approve anything.
 
I may have gone and approved them =)
 
oh so I am getting notified after.
 
3:31 PM
Hm, might be a config thing
 
Wait, no. I did get "moderate' email
I had missed because I already got another email about new comment from the same commentor
BTW, something weird. I apparently can't do anything in the .... I don't know what to call it .... blue admin area. It keeps saying I don't have permissions.
But, if i go to the WP admin, I can do the same thing that the blue admin area say I didn't.
 
hm, might have been the role thing. wasn't sure which one you'd want to take up (or what the difference is between "author" and "collaborator") ...if you want admin I'm happy to give it to you :)
 
Nah, it works fine for what I need; and don't mind going to WP admin (it's more familiar to me anyway - I have no idea what that blue admin thingy is all about. Must be a WP.com thing).
Just wanted to mention that because it does seem weird that one admin site would say I don't have permission but other admin site says I can do. Go figure!
(The mistake is probably in the fact that they thought it a good idea to have 2 admin pages, lol)
 
Administrator
Editor
Author <~
Contributor
^ the WP roles
no idea what the difference is between the last 3
ah, got it
> Administrator (slug: ‘administrator’) – somebody who has access to all the administration features within a single site.
Editor (slug: ‘editor’) – somebody who can publish and manage posts including the posts of other users.
Author (slug: ‘author’) – somebody who can publish and manage their own posts.
Contributor (slug: ‘contributor’) – somebody who can write and manage their own posts but cannot publish them.
Subscriber (slug: ‘subscriber’) – somebody who can only manage their profile.
if I read this correctly, "editor" means you'd get to see all my unpublished drafts
 
I think I would say that the permission are not in sync.
Because in the blue admin thingy, I apparently cannot do much.
But in WP admin page, I can do everything, as if I were the administrator.
I can see your drafts and approve comments, etc.
Just not from that blue area.
 
3:46 PM
WP gonna be WP
 
^
the hilarious thing is that there's a link to WP admin right there on the left sidebar in the blue area
HERE'S A BACKDOOR FOR YOU!
 
0
Q: Optimize filtering array using sorting and find out when is convenient

Davide ToninI'm trying to optimize my filter Arrays algorithm (1-Is this an algorithm?) so I've thought to use the sorted column (when available). The original function loop through all items in the array, make comparison in various columns and build the resulting array. In this new version, I want to redu...

 
4:12 PM
@this glad to be of some help
about to take the kids to the zoo; during nap time i'll try to do my reread
 
4:37 PM
@Cyril be willing to come back to the article 6mo to 1yr later and reread with more knowledge. That’s what I did for a lot of different topics.
Which is what made me realize how much I’ve learned in trying and failing, even when it felt I wasn’t learning anything.
 
I'm revisiting my "OOP VBA: Immutability & the Factory Pattern" article (damn my old articles were tiny!) ...it's the blog's most-viewed article, and with hindsight I can see how it's confusing & hard to follow. Will also upload accompanying code to the Examples repository
 
 
1 hour later…
6:03 PM
-1
Q: Calculate when is convenient taking advantage of sorting in filtering arrays

Davide ToninI'm trying to optimize my FilterArray function so I've thought to use the sorted column (when available). The original function loops through all items in the array, make comparison in various columns and build the resulting array. In this new version, I want to reduce the number of main loop's...

 
6:29 PM
Do you feel your ability to explain the content has improved? Or is your understanding of the material better that lets your explain clearer?
 
 
3 hours later…
9:41 PM
> >
>
> @mansellan
>
> > At the loss of Vista and Windows 8 (original). We'd retain support for Win7, 8.1 and 10.
>
> Would it be worthwhile to multitarget both .NET Core and .NET Framework? The SDK-style project format [allows this very simply](https://docs.microsoft.com/en-us/dotnet/standard/frameworks).

Perhaps. The server can be any language at all, I just suggested .Net Core as it has performance-related constructs that aren't (and will never be) available in .Net Framework. Vi
 
Been catching up with chat, and whilst its nice to see VB6 getting some attention, I wonder how realistic it is to create a new compiler from scratch whilst retaining full compatibility. It's also disappointing that it doesn't look like it'll be open-source. If it was GPL, I'd contribute.
It's also curious that a new IDE would be necessary. It seems easier to just provide language and debug services to VSCode (or other LSP clients).
AFAIU, even VB6 native executables use MSVBM for various functions, it's not clear from the site if and how that can be decoupled or avoided.
Right now, to me, it looks like vapourware. I'd love to be proven wrong.
 
> > Would it be worthwhile to multitarget both .NET Core and .NET Framework? The SDK-style project format [allows this very simply](https://docs.microsoft.com/en-us/dotnet/standard/frameworks).

[See the comments in this PR](https://github.com/rubberduck-vba/Rubberduck/pull/5239). There'll have to be few more changes before that is feasible.
 
10:10 PM
@mansellan I have an active DM chat on Twitter with the guy, sent them a link to the mocking framework PR and invited them to comment - let's see where that goes :)
 
Like I say, I'd love to be wrong...
dzzie also has a handle on the lowest level, reversing opcodes and hooking the debugger. Again though, not (yet?) open-source...
 
TBH I've seen too many fake "VB6 alternative IDEs" mock-ups that made the same claim, I have to say I'm suspicious of that one too. But, the video says it's not a mock-up and it actually is what it claims it is (well duh!) ...maybe I just want to believe it, but anyway they say they do have a working type converter, so...
 
I find it hard to trust anything I can't see the source for...
 
10:25 PM
Trust, but verify ask for source code
 
Did you see the vid where it suddenly compiled to x64? No idea how that would be possible without an x64 MSVBVM.dll. Even hello world needs it...
 
If it was running in 64-bit, then I'm more inclined to think they wrote their own runtime library
or doing some kind of transpiling tricks.
 
@Duga @this that's kind of part of the idea. Language Server would split Rubberduck into two distinct executables, one that plugs into the VBE and a standalone language server that can parse VBA/6
 
Or... just mocking some console output. Am I too cynical?
 
hey, Lucas say we can put people on green screen in a whole world with all flying laser blasts and whizzing hovercrafts and various alien creatures!
@Vogel612 I'm easily confused and can't remember which direction --- one can reference the other but not the vice versa. Wasn't it .NET FX that can't reference a .NET Core?
 
10:31 PM
I think neither...
either way, the source trees would be basically distinct
 
Oh, if it's IPC, then references isn't needed.
 
^
netfx cannot reference netcore, and netcore cannot reference netfx. they can both reference netstandard, as long as they understand the version. netfx will never understand more than v2. netcore is already at 2.1.
hence, netstandard is a bridge
but, soon to be irrelevant
 
yeah, I would consider the .NET 5 to be an improvement over the 3-headed .NET thingamiges, though Mat might still feel that it's basically breaking everything for the fun of it.
 
there's even talk of dropping netstandard, as its served its purpose.
 
Anyway, yeah LSP would have much more independence and can be .NET Core or even be in PHP or Perl (!).
 
10:36 PM
I thought that was always the plan
@this yea, but no.
 
iiuc, the thinking was this... "we need to start again with .net. how do we do that without pissing everyone off? lets say from the start that its not fully compatible, but provide some way to migrate".
 
maybe in Rust
 
@this Yes. But not Java. Please.
 
Oh, ok, assembly then. I hear it's really fast.
 
Oh, you want an assembler to arrange your opcodes??? If you need mnemonics, you're ot a "real programmer"
;-)
 
10:38 PM
@Vogel612 You know, I wonder if a Rust VBIDE add-in would be less troublesome compared to a managed add-in. The COM support is still primitive, though.
@mansellan I thought it was already established that I'm a quiche eater.
 
dunno about writing GUI in such a low-level language, but if we can call into Rust from C#, I'd volunteer to reimplement the COM interaction in that language
I should actually check that out
 
There's a com crate and I've been futzing with it a bit.
But the way it is, I think it is quite basic and probably need more development. At least it could be done.
 
> NOTE This crate is currently in heavy development as we decide on a stable API.
 
The problem, though, is that if you use C# to call into Rust, you're still going to bump up against the managed/unmanaged boundary.
 
rust for the frontend? why not keep that in netfx, and put the difficult stuff in rust?
 
Yep, that's the one.
 
@this true, but we're going to control it, which might net us some benefits
 
and as far as I can see, it only deals with IUnknown. No IDispatch support.
 
if we do front end/back end, the front end can be wasteful, it's only collecting events and painting a UI...
so, whatever's easiest?
 
probably stay with our existing codebase, so netfx
 
10:44 PM
it doesn't have to keep huge graphs ruthlessly optimised...
 
The other thing is that if the com crate requires unsafety, I'm not so sure we get much from Rust.
Might as well just write the direct interaction code in C
 
rust actually has some proper memory management features as compared to C
that's kind of the whole point of rust
 
so does net core recently
 
even if we have unsafe structs?
 
net core lets you do low level memory without going unsafe
 
10:46 PM
I assumed we lose out if we have to mark the functions unsafe, which the com crate requires all COM-exposed functions to be.
@mansellan we are actually kind of already doing that with .NET fx
 
net fx doesn't have all of the span constructs. I think it emulates some of them, but not as effeciently.
net core is going all out for allocation minimisation
 
Correct. It could be better. I'm also thinking about the message pump & subclassing - if that can be made unmanaged and thus not have to cross managed/unmanaged boundary for every Windows messages that might help.
Then there's the whole stupid WPF thing.... Once it's initialized, it's forever and more initialized, even if you unload everything else.
 
yeah good point. but i think most of our memory is in the backend.
 
Yes two separate issues.
 
lol ...
> Topics that are within the scope of this book include: the meaning of (un)safety, unsafe primitives provided by the language and standard library, [...], working with uninitialized memory, type punning, concurrency, interoperating with other languages (FFI), optimization tricks, how constructs lower to compiler/OS/hardware primitives, how to not make the memory model people angry, how you're going to make the memory model people angry, and more.
 
10:52 PM
My comment RE: subclassing would not help reduce the memory issue but it may help avoid lagging or UI issues. (whether that's actually an issue is another question)
 
which book?
 
love that title!
 
> So what does this have to do with Rust?

Well, unlike C, Rust is a safe programming language.

But, like C, Rust is an unsafe programming language.
 
LOL
That is a true statement... Just need more wording.
 
10:54 PM
> Rust can be thought of as a combination of two programming languages: Safe Rust and Unsafe Rust.
 
unlike C, Rust is safe programming language as far as you stay in Rust's sandbox, but Rust itself has to run unsafely to make Rust possible would be how I'd put it.
 
So, what needs to be done to prove the concept of a front-end/back-end split? Is it enough for me to say "I'm sure this will work"?
 
Hmm, I guess that probably explain why com needs to be unsafe; it's an ABI, so you must conform to it at binary level, and it's hard to do if you're working safely.
 
(kidding!)
 
yea, that's basically the issue
 
10:57 PM
@mansellan seriously, easiest to start with C# for both ends. Just need a PoC in C# and we can go from there.
 
you cannot enforce the compiler guarantees onto external code, so anything interacting with external code on a binary level is unsafe from rust's perspective
@mansellan you could actually go so far as to implement an in-process language server
and then splitting it becomes a matter of turning the in-process communication to a between process communication
note that it's later going to be necessary to split up the test project(s) so we can do that
 
ok, so joking aside... what are we looking to prove out? the protocol is known, there are implementations on both the client and server side. Do we want to demostrate that a VBE add in can get and use results from an LSP conversation?
because that's just demonstating that we can read and write JSON, so...
 
I think the core issue is starting and shutting down the language server process
 
@Vogel612 oh... seems trivial?
 
one thing i'm a bit fuzzy is whether that replaces or ties into ANTLR.
 
11:01 PM
'cause we only control the AddIn as an entry-point
 
@Vogel612 so long as we can Process.Start, we're golden?
 
and if there's multiple Rubberduck instances when do we shut down?
 
@this antlr just moves to the back-end
 
I think the server will need to do ref-counting somehow.
 
@this IIUC it's intended as using ANTLR to implement the language server
 
11:02 PM
^
 
So we just send the source code?
 
iiuc each client starts its own server. server-sharing is an advanced use-case, not common.
 
huh, yea that makes things easier
 
we could do that for now, yeah.
 
then we just need to make sure we actually clean the server up..
 
11:03 PM
should be doable; we have addin shutdown event for that.
 
or are child-processes automatically killed on windows?
 
@this in the trivial case, yes. you can send it, you can export/import it, or if you're feeling plush you can send deltas.
 
hm, does Windows have such thing as child process?
Ideally, we should send only the deltas
 
yes. doable but fancy.
 
so the PoC need to demonstrate that we can set up the server, feed it with the whole project then send only the delta.
So that it is able to do re-parsing all it wants in background without locking up the VBIDE UI
(and more importantly without hogging up the host's memory)
 
11:05 PM
We also ask the VBE for information at a gazillion places.
That would have to be decoupled.
 
The other issue to prove out is that when we display the results from the server, the UI doesn't need to hog up host's memory either.
 
BTW, just been to a great concert.
 
needs good bass to get the proper experience
 
seems like an acquired taste...
 
also advanced German makes the stuff they put out much better
 
11:08 PM
They do a really great show.
 
been kinda addicted to these guys recently
 
that band has it's own canon. It's a bit... madness
 
True, if you understand the texts, it is really great.
Madness is a good description.
With the Language server, my main concern are the interaction where we tap int tie internals of the VBE via the typeLib API.
 
11:24 PM
@M.Doerner why so?
 
I think we do that at several places in the parsing process.
We still have to do that on the add-in side.
 
for vba projects? or for referenced libraries?
 
The language server has no access to it directly.
VBA projects.
Stuff like compilation arguments and the user project com projects.
 
yeah.. for VBA projects we'd have to reflect, serialise, and send to the server.
we could save some time by hashing first and caching. solves referenced libraries, could be expensive for vba projects under construction.
 
Moreover, there are some inspections and other stuff that actively query the vbe object model.
We basically have to disentangle that.
 
11:29 PM
I don't think we gain a lot if we keep everything from the declaration level in the addin
the parse-tree itself isn't that much memory, the more interesting things are declarations
 
iirc (would have to check the specs) the back end can inspect and send results. not sure if that helps...
 
We have to pass (most of) that information back to display stuff.
 
yea it can, but it's basically a RPC implementation over JSON
 
To really get a benefit, we would have to strip the non-essential information from what we send back.
 
yes - the back end has to be able to completely comprehend the source. if inspections later inspect the vbe, that's a problem...
 
11:32 PM
But before we start to try it, we will not really see whether that can be done in a sane way.
I think some inspections still do. However, I already removed some o that stuff in my recent PRs.
I do not really like it when too much stuff accesses the vbe API anyway, since any interaction bares the risk to get the com cleanup wrong.
 
@Vogel612 It's JSON-RPC...
With a messaging protocol on top
 
if we control the implementation, we might just as well invoke the methods directly with framework implementations of RPC
 
well they define loads of messages, for things like "Show intellisense", "Go to declaration", etc. Hopefully most of our scenarios are covered, and we can define custom messages where not.
Oh and they have a protocol for debugging too, for when we find how to hook that :-)
 

« first day (2094 days earlier)      last day (1086 days later) »