rjones (Thu, 14 May 2020 14:03:40 GMT):
seanyoung

rjones (Thu, 14 May 2020 14:03:48 GMT):
Enjoy!

seanyoung (Thu, 14 May 2020 14:39:23 GMT):
Great, thank you @rjones !

sbalikondwar (Thu, 14 May 2020 15:02:02 GMT):
Has joined the channel.

sbalikondwar (Thu, 14 May 2020 15:02:07 GMT):
Hi there

seanyoung (Thu, 14 May 2020 15:58:01 GMT):
This channel was just created

rjones (Thu, 14 May 2020 16:00:59 GMT):
Has left the channel.

seanyoung (Thu, 14 May 2020 16:12:27 GMT):
Solang Solidity Compiler

seanyoung (Thu, 14 May 2020 16:12:27 GMT):
https://github.com/hyperledger-labs/solang

knagware9 (Sat, 16 May 2020 08:50:40 GMT):
Has joined the channel.

sbalikondwar (Sun, 17 May 2020 07:20:22 GMT):
I was going through the timeline and I see that there will be very little time to document plan before the start of coding period for sls So I am a bit puzzled how will the planning phase be. Any idea @seanyseanyoung like when will the student work on the draft of project plan which is quite important before starting any work. If I can keep working on the points I have discussed with you so far, let me know.

sbalikondwar (Sun, 17 May 2020 07:20:22 GMT):
I was going through the timeline and I see that there will be very little time to document plan before the start of coding period for sls So I am a bit puzzled how will the planning phase be. Any idea @seanyoung like when will the student work on the draft of project plan which is quite important before starting any work. If I can keep working on the points I have discussed with you so far, let me know.

sbalikondwar (Sun, 17 May 2020 07:20:22 GMT):
I was going through the timeline and I see that there will be very little time to document plan before the start of coding period for sls So I am a bit puzzled how will the planning phase be. Any idea @seanyoung like when will the student work on the draft of project plan which is quite important before starting any work. I can keep working on the points I have discussed with you so far and update the draft I have with me.

sbalikondwar (Sun, 17 May 2020 07:20:22 GMT):
I am just checking cause it would be more productive to directly start with coding with having the plan set before as the project will take quite some time in testing and integration phases.

sbalikondwar (Sun, 17 May 2020 07:20:22 GMT):
I was going through the timeline to check about the project planning phase, I see that there will be very less time to work on the plan and the program will begin with the coding phase. @seanyoung it is expected that more time is needed for the integration and testing phase, so it would be more productive to have the planning phase take less time. For now, I was working on the info gathered from the discussions. What do you think?

sbalikondwar (Sun, 17 May 2020 07:20:22 GMT):
I was going through the timeline to check about the project planning phase, I see that there will be very less time to work on the plan and the program will begin with the coding phase. @seanyoung it is expected that more time is needed for the integration and testing phase, so it would be more productive to have the planning phase take less time. For now, I am working on the info gathered from the discussions. What do you think?

sbalikondwar (Sun, 17 May 2020 07:22:05 GMT):
I am just checking cause it would be more productive to directly start with coding with having the plan set before.

seanyoung (Mon, 18 May 2020 19:53:19 GMT):
@sbalikondwar what timeline are you looking at?

sbalikondwar (Mon, 18 May 2020 19:55:08 GMT):
Part time

sbalikondwar (Mon, 18 May 2020 19:55:11 GMT):
Is it fine ?

seanyoung (Mon, 18 May 2020 19:57:04 GMT):
I don't mind, whatever suits you best. I just wake up every day and work on Solang, nothing else happening in my life :laughing:

sbalikondwar (Mon, 18 May 2020 19:58:05 GMT):
Ah great, excited for an experience of lifetime

sbalikondwar (Mon, 18 May 2020 19:58:50 GMT):
I am completing the paperwork then will discuss the further proceeding.

seanyoung (Mon, 18 May 2020 20:03:41 GMT):
Fantastic! I'm looking forward to it.

sbalikondwar (Thu, 21 May 2020 19:19:31 GMT):
Evening @seanyoung I sent the complete document to the organisation, waiting for confirmation. Just posted to keep you updated on the process.

seanyoung (Thu, 21 May 2020 19:20:20 GMT):
Great, thanks!

sbalikondwar (Mon, 25 May 2020 13:52:07 GMT):
Hi there sean, looks like I have completed the documentation. It's late today, from tomorow will join in and discuss the remaining work and the process. Let me know about your availability cause we both are from different time zones so that I can easily clear out doubts.

sbalikondwar (Mon, 25 May 2020 13:52:07 GMT):
Hi there sean, looks like I have completed the documentation. It's late today, from tomorow will join in and discuss the remaining work and the process. Let me know about your availability cause we both are from different time zones so that I can easily clear out doubts without any time clashes

seanyoung (Mon, 25 May 2020 21:30:45 GMT):
Hi there, that's good to hear! My calendar is pretty empty. Anytime after 10:00 BST is good for me.

sbalikondwar (Wed, 27 May 2020 08:21:46 GMT):
Morning @seanyoung as start of work I am investigating the client side of the sls project

sbalikondwar (Wed, 27 May 2020 08:22:32 GMT):
will try to hack in and see if I can send in any requests from ide and print it in console

sbalikondwar (Wed, 27 May 2020 08:23:24 GMT):
this can then be backed up at server side by solang backend and we can do all our desired features.

seanyoung (Wed, 27 May 2020 08:49:53 GMT):
Perfect! Please let me know how are you are getting on or if I can help in any way.

sbalikondwar (Thu, 28 May 2020 13:25:39 GMT):
yes so yesterday I was reading on how to create a language (new) support

sbalikondwar (Thu, 28 May 2020 13:25:39 GMT):
yes so yesterday I was reading on how to create a language (new) support in vscode

sbalikondwar (Thu, 28 May 2020 13:27:01 GMT):
i came to know that i need to write some grammer for it first and was searching and reading on the language servers like how the plugins are written for client side

sbalikondwar (Thu, 28 May 2020 13:27:25 GMT):
i was referring some blogs which i am still working on wait i will post it

sbalikondwar (Thu, 28 May 2020 13:28:08 GMT):
i went on with vscode cause most of the people nowadays use it and it is relatively easy to port this functionality to other ide's

sbalikondwar (Thu, 28 May 2020 13:28:08 GMT):
i went on with vscode cause most of the people nowadays use it and it is relatively easy to port this functionality to other ide's from vscode

sbalikondwar (Thu, 28 May 2020 13:29:19 GMT):
one of the resource i am referring https://www.codemag.com/Article/1809051/Writing-Your-Own-Debugger-and-Language-Extensions-with-Visual-Studio-Code

sbalikondwar (Thu, 28 May 2020 13:29:38 GMT):
good afternoon by the way

seanyoung (Thu, 28 May 2020 13:44:31 GMT):
Hi, afternoon

seanyoung (Thu, 28 May 2020 13:44:50 GMT):
well evening for you

seanyoung (Thu, 28 May 2020 13:48:17 GMT):
So the idea here is to use Solang as the parser, not generate a new one. That way, when a user types some code they get the same result in the editor as on the command line. This also means there is no need to maintain two grammars; Solang's grammar is evolving rapidly as I add features.

seanyoung (Thu, 28 May 2020 13:49:42 GMT):
Solang is written in rust, so the language server also has to be written in rust.

seanyoung (Thu, 28 May 2020 13:50:18 GMT):
See https://code.visualstudio.com/api/language-extensions/language-server-extension-guide

sbalikondwar (Thu, 28 May 2020 13:51:00 GMT):
yes correct that is helpful link

sbalikondwar (Thu, 28 May 2020 13:51:38 GMT):
i was looking at the my resource as a sample for implementation but it is correct that we have to achieve it using rust and that too using solang

sbalikondwar (Thu, 28 May 2020 13:52:39 GMT):
tea time :tea:

seanyoung (Thu, 28 May 2020 15:20:02 GMT):
I'm having tea as well

sbalikondwar (Fri, 29 May 2020 10:14:31 GMT):
afternoon @seanyoung

seanyoung (Fri, 29 May 2020 10:14:45 GMT):
afternoon!

seanyoung (Fri, 29 May 2020 10:14:47 GMT):
how are you?

sbalikondwar (Fri, 29 May 2020 10:15:08 GMT):
good reading on the docs you pointed, half way

seanyoung (Fri, 29 May 2020 10:21:22 GMT):
ok, that's good

sbalikondwar (Fri, 29 May 2020 13:30:47 GMT):
finshed them, thought to look at rust extension to see how the developers have added the server and client communication side and alongside will code some impl

sbalikondwar (Fri, 29 May 2020 13:32:27 GMT):
sorry for the delay, i fall asleep

sbalikondwar (Fri, 29 May 2020 13:33:22 GMT):
how are you

seanyoung (Fri, 29 May 2020 14:53:01 GMT):
I'm good. So does the language server listen on a regular tcp port?

sbalikondwar (Mon, 01 Jun 2020 10:50:27 GMT):
@seanyoung are you talking about the rls server or lsp-samples ?

seanyoung (Mon, 01 Jun 2020 10:50:44 GMT):
rls server in general

sbalikondwar (Mon, 01 Jun 2020 10:51:38 GMT):
good afternoon, this weekend had to do some shifting of things of my dormitory

seanyoung (Mon, 01 Jun 2020 10:52:35 GMT):
good afternoon!

sbalikondwar (Mon, 01 Jun 2020 10:52:54 GMT):
will take look and let you know

sbalikondwar (Mon, 01 Jun 2020 10:53:16 GMT):
today there is a screening session for the mentee in 2 hours

seanyoung (Mon, 01 Jun 2020 10:53:50 GMT):
ah ok. What will happen there?

sbalikondwar (Mon, 01 Jun 2020 10:55:00 GMT):
introduction to the program, what is expected from mentees sort of explaination of the duties and things to keep in mind during the program.

seanyoung (Mon, 01 Jun 2020 10:57:52 GMT):
right ok. Once that is done, we should start to make a plan. Or a plan for a plan :)

sbalikondwar (Mon, 01 Jun 2020 10:59:03 GMT):
yeah sounds good, till then will check the tcp thing

seanyoung (Mon, 01 Jun 2020 11:07:14 GMT):
thanks

sbalikondwar (Mon, 01 Jun 2020 13:51:06 GMT):
i see that there will also be mentors onboarding session @seanyoung

sbalikondwar (Mon, 01 Jun 2020 13:52:17 GMT):
just notifying if you forgot :)

seanyoung (Mon, 01 Jun 2020 14:12:49 GMT):
I'm on, thank for you for reminding @sbalikondwar

seanyoung (Mon, 01 Jun 2020 15:07:07 GMT):
Ok the session is finished now. How are things?

sbalikondwar (Mon, 01 Jun 2020 16:46:24 GMT):
I was having dinner, its late today can we do it tommorow @seanyoung

seanyoung (Mon, 01 Jun 2020 17:04:00 GMT):
Sounds good! What time suits?

sbalikondwar (Mon, 01 Jun 2020 17:05:31 GMT):
Usual like anytime from 12:00 IST I'll ping you

seanyoung (Mon, 01 Jun 2020 17:19:16 GMT):
Ok I might not be up by then, I'm around from 9:00 BST usually

sbalikondwar (Mon, 01 Jun 2020 17:19:50 GMT):
Ok no problem you pine me once available

sbalikondwar (Tue, 02 Jun 2020 06:00:27 GMT):
Just dropping some doubts here, first one is as i read from rls clients doc "The LSP is a fairly simple JSON over stdio protocol. The interesting bit is tying the client end of the protocol to functionality in your editor.:

sbalikondwar (Tue, 02 Jun 2020 06:01:07 GMT):
So the language server won't listen over tcp port!

sbalikondwar (Tue, 02 Jun 2020 06:01:59 GMT):
But its not impossible as we see nowadays telemetry feature is available in editors, which infact should be using tcp

sbalikondwar (Tue, 02 Jun 2020 06:26:11 GMT):
One thing I came to know is we need to write the client side/plugins for editor in typescript

sbalikondwar (Tue, 02 Jun 2020 06:27:44 GMT):
I read through your link you sent me couple of days ago and i read the process for plugin, as the first point of contact is editor plugins itself writing a dummy plugin

sbalikondwar (Tue, 02 Jun 2020 06:33:09 GMT):
https://code.visualstudio.com/api/language-extensions/overview

sbalikondwar (Tue, 02 Jun 2020 06:37:02 GMT):
https://code.visualstudio.com/api/get-started/your-first-extension

seanyoung (Tue, 02 Jun 2020 08:15:20 GMT):
Hello, good afternoon

seanyoung (Tue, 02 Jun 2020 08:17:11 GMT):
So reading through that, there is some typescript needed which will launch the solang language server (rust side) and then communicate with it, right?

seanyoung (Tue, 02 Jun 2020 08:23:27 GMT):
Ah so RLS has this: https://github.com/rust-lang/rls-vscode/

sbalikondwar (Tue, 02 Jun 2020 08:25:50 GMT):
good afternoon

sbalikondwar (Tue, 02 Jun 2020 08:26:16 GMT):
correct that's the way.

sbalikondwar (Tue, 02 Jun 2020 08:26:44 GMT):
yes rls has rls-vscode as extension

seanyoung (Tue, 02 Jun 2020 08:27:38 GMT):
Ok. It's becoming clearer how this should fit together

seanyoung (Tue, 02 Jun 2020 08:29:17 GMT):
Shall we have a conversation about planning? We can use https://meet.jit.si/SolangProject or use this channel.

sbalikondwar (Tue, 02 Jun 2020 08:29:19 GMT):
So as rls has rls-vscode as extension that vscode client uses to communicate throught stdio JSON RPC.

sbalikondwar (Tue, 02 Jun 2020 08:29:34 GMT):
Now?

seanyoung (Tue, 02 Jun 2020 08:30:05 GMT):
Whenever suits you, I'm available whenever

sbalikondwar (Tue, 02 Jun 2020 08:30:19 GMT):
ok i will ready myself in 5 min

sbalikondwar (Tue, 02 Jun 2020 08:30:28 GMT):
I'll ping you once done

sbalikondwar (Tue, 02 Jun 2020 08:34:23 GMT):
join in @seanyoung

seanyoung (Tue, 02 Jun 2020 09:32:40 GMT):
@sbalikondwar this is the Fabric Private Data Object I was talking about https://github.com/hyperledger-labs/private-data-objects

sbalikondwar (Tue, 02 Jun 2020 12:17:49 GMT):
looks good

sbalikondwar (Tue, 02 Jun 2020 12:18:10 GMT):
by the way how is the weather there?

seanyoung (Tue, 02 Jun 2020 13:54:07 GMT):
It's very nice here, last day of nice weather so I've been reading a book on parsing outside :) How is for you?

sbalikondwar (Tue, 02 Jun 2020 13:58:33 GMT):
experiencing first monsoon of the year, and possibly first cyclone of the century https://economictimes.indiatimes.com/news/politics-and-nation/low-pressure-over-arabian-sea-to-intensify-into-cyclonic-storm-soon-imd/articleshow/76117428.cms

sbalikondwar (Tue, 02 Jun 2020 14:00:53 GMT):
my town is not in the red alert zone but as the city is quite near to the red alert region can expect heavy rains and power outage(due to this cyclone)

seanyoung (Tue, 02 Jun 2020 14:03:52 GMT):
oh dear!

sbalikondwar (Tue, 02 Jun 2020 14:04:37 GMT):
Nothing to worry though 😀

sbalikondwar (Tue, 02 Jun 2020 14:06:02 GMT):
anyways will work on the plan and goals, taking leave for today. See you tommorow

sbalikondwar (Tue, 02 Jun 2020 14:06:02 GMT):
anyways will work on the plan and goals, taking leave for today. See you tomorow

sbalikondwar (Tue, 02 Jun 2020 14:06:02 GMT):
anyways will work on the plan and goals, taking leave for today. See you tomorrow

seanyoung (Tue, 02 Jun 2020 14:20:29 GMT):
Still not good! Hope things don't get too bad.

seanyoung (Tue, 02 Jun 2020 14:20:50 GMT):
See you tomorrow, have a good evening!

seanyoung (Wed, 03 Jun 2020 06:55:47 GMT):
@sbalikondwar Afternoon, how is the weather? Not too bad I hope!

sbalikondwar (Wed, 03 Jun 2020 08:17:37 GMT):
Good afternoon

sbalikondwar (Wed, 03 Jun 2020 08:19:18 GMT):
Rain and strong winds, The cyclone will hit in half hour and estimated to be for 3-4 hours, for safety power cut has taken place

sbalikondwar (Wed, 03 Jun 2020 08:21:32 GMT):
I have some juice in my laptop so can work for now, This should not take long though

seanyoung (Wed, 03 Jun 2020 08:22:58 GMT):
oh dear! Hopefully it passes without much incidence..

sbalikondwar (Wed, 03 Jun 2020 08:23:27 GMT):
yes

sbalikondwar (Wed, 03 Jun 2020 08:24:40 GMT):
some updates here https://timesofindia.indiatimes.com/city/mumbai/cyclone-in-mumbai-live-updates-cyclone-nisarga-to-make-landfall-in-maharashtras-alibaug/liveblog/76147402.cms

sbalikondwar (Wed, 03 Jun 2020 08:24:54 GMT):
working on the extension now

sbalikondwar (Wed, 03 Jun 2020 09:08:09 GMT):
So i was looking at the api https://code.visualstudio.com/api/references/vscode-api and rls-vscode extension in parallel, i have started to understand the roles languageclient and other important components in the API

sbalikondwar (Wed, 03 Jun 2020 09:08:35 GMT):
as you can see in the api link, you will get a command component

sbalikondwar (Wed, 03 Jun 2020 09:09:42 GMT):
what i am thinking for sending the messages we can create commands using registercommand and then do following process like

sbalikondwar (Wed, 03 Jun 2020 09:10:09 GMT):
commands.registerCommand('extension.sayHello', () => { window.sendupdatestostdio('solang file'); });

sbalikondwar (Wed, 03 Jun 2020 09:11:57 GMT):
so i am also understanding the rls-vscode code, too bad my laptop is very low on battery will join in after sometime @seanyoung

seanyoung (Wed, 03 Jun 2020 09:55:35 GMT):
On the solang side, we want to get the language server request as json. Then we can deserialize it with https://crates.io/crates/lsp-types, process it and send a response.

seanyoung (Wed, 03 Jun 2020 09:57:16 GMT):
For now, doing this via stdio is fine. It does means that for every request a new solang process get spawned. Making the solang process longer lived is a performance optimization which we don't need to worry about (this probably does need tcp).

seanyoung (Wed, 03 Jun 2020 09:58:02 GMT):
Actually, it might be able to multiple requests over stdio, but I digress: no reason to worry about this

seanyoung (Wed, 03 Jun 2020 09:59:20 GMT):
So we have a "solang --language-server" mode which takes language server requests on stdin/prints results on stdout.

sbalikondwar (Wed, 03 Jun 2020 14:35:42 GMT):
there is also support for threads, i just did a small overview

sbalikondwar (Wed, 03 Jun 2020 14:35:59 GMT):
power back, cyclone passed away

sbalikondwar (Wed, 03 Jun 2020 14:37:23 GMT):
Not much destruction than expected, some tree, shed falling but overall everything went good it was first in my lifetime to experience this calamity

sbalikondwar (Wed, 03 Jun 2020 14:37:23 GMT):
Not much destruction than expected, some tree, shed falling but overall everything went good it was first in my lifetime to experience such calamity

seanyoung (Wed, 03 Jun 2020 17:14:36 GMT):
Ok, well that is good considering what could have been!

sbalikondwar (Thu, 04 Jun 2020 07:26:19 GMT):
good morning @seanyoung

seanyoung (Thu, 04 Jun 2020 08:00:30 GMT):
Good morning, how are you?

seanyoung (Thu, 04 Jun 2020 08:02:30 GMT):
Turns out the project plan should go here: https://wiki.hyperledger.org/display/INTERN/Create+a+new+Solidity+Language+Server+%28SLS%29+using+Solang+Compiler#

seanyoung (Thu, 04 Jun 2020 08:47:08 GMT):
How are things looking after cyclone?

sbalikondwar (Thu, 04 Jun 2020 08:59:52 GMT):
things are good, joined in early today looking in the extension

seanyoung (Thu, 04 Jun 2020 09:13:19 GMT):
I think solang needs some refactoring to make it easier to extract all the information the language server needs, I'm looking into that.

sbalikondwar (Thu, 04 Jun 2020 09:21:11 GMT):
ok, that's very helpful

sbalikondwar (Thu, 04 Jun 2020 14:38:00 GMT):
i worked on adding child process in the command section through which i can send in file status through the console

sbalikondwar (Thu, 04 Jun 2020 14:38:23 GMT):
it's night here, taking off for today.

sbalikondwar (Thu, 04 Jun 2020 14:38:45 GMT):
by the way how is the covid situation there

sbalikondwar (Thu, 04 Jun 2020 14:40:27 GMT):
by child process i mean threads to asynchronously get and send op through the stdio, but i hit some error need to rectify them

sbalikondwar (Thu, 04 Jun 2020 15:17:45 GMT):
going for dinner, see you tommorow

sbalikondwar (Thu, 04 Jun 2020 15:17:45 GMT):
going for dinner, see you tomorrow

seanyoung (Thu, 04 Jun 2020 19:46:54 GMT):
sounds like you're making progress, that's good to hear

seanyoung (Thu, 04 Jun 2020 19:48:36 GMT):
Lockdown is slowly being eased here. I have left the house only twice since the beginning of March.

seanyoung (Thu, 04 Jun 2020 21:34:15 GMT):
How is your covid situation?

sbalikondwar (Fri, 05 Jun 2020 19:29:46 GMT):
it is mixed kind of reaction, on one side as india has big population the cases are expected to be increase despite of the effort but our recovery rate is around 40-45 percent which is good and on the other side economy and shops are opening in a phased manner

sbalikondwar (Fri, 05 Jun 2020 19:30:54 GMT):
sorry i forgot to greet today, i worked for sometime and will work in weekends as well.

sbalikondwar (Fri, 05 Jun 2020 19:30:54 GMT):
sorry i forgot to greet today, i worked for sometime today and will work in weekends as well.

seanyoung (Sat, 06 Jun 2020 09:51:44 GMT):
Hi, how are you? Please don't forget the plan

seanyoung (Sat, 06 Jun 2020 09:55:18 GMT):
Currently Solang takes the parse tree and produces the CFG from that. That's not ideal, it's harder to get the symbol information out of it like that. So, I'm writing a new stage for solang which is like clang sema. The pipeline was src -> parser (out: parse tree) -> resolver (out: cfg) -> emitter (out: wasm) The new pipeline src -> parser (out: parse tree) -> sema (out: resolved AST) -> codegen (out: cfg) -> emitter (out: wasm)

seanyoung (Sat, 06 Jun 2020 09:55:39 GMT):
So I'm kind of splitting the resolver into two stages.

sbalikondwar (Sat, 06 Jun 2020 10:51:22 GMT):
yes will update till monday

seanyoung (Sun, 07 Jun 2020 09:01:28 GMT):
@sbalikondwar Hello, good afternoon. Thanks for uploading the plan! Looks good. I'll have things ready on the Solang side for when you get to that point.

seanyoung (Sun, 07 Jun 2020 09:02:01 GMT):
How are you getting on?

seanyoung (Sun, 07 Jun 2020 09:02:11 GMT):
Anything I can help with?

sbalikondwar (Sun, 07 Jun 2020 09:03:53 GMT):
Good afternoon

sbalikondwar (Sun, 07 Jun 2020 09:04:58 GMT):
I uploaded status, will need to some things I have just in middle of my meal 😀, will let you know.

seanyoung (Sun, 07 Jun 2020 11:15:55 GMT):
Sure, just let me know

sbalikondwar (Sun, 07 Jun 2020 21:11:50 GMT):
Well its late today, I uploaded the changes made till now here:https://github.com/Hyperion101010/sls

sbalikondwar (Sun, 07 Jun 2020 21:12:32 GMT):
needed to add grammer for solidity and file scheme which is now added

sbalikondwar (Sun, 07 Jun 2020 21:14:15 GMT):
About the message communication i wrote some client side code which now is to be attached with server side, the code can be seen in src/extension.ts

sbalikondwar (Sun, 07 Jun 2020 21:14:52 GMT):
Now you will get some errors, which I are to be sorted out for which I contacted the vscode help slack channel

sbalikondwar (Sun, 07 Jun 2020 21:14:52 GMT):
Now you will get some errors, which are to be sorted out for which I contacted the vscode help slack channel

sbalikondwar (Sun, 07 Jun 2020 21:15:40 GMT):
It was expected so haven't heard back from them till now.

sbalikondwar (Sun, 07 Jun 2020 21:15:40 GMT):
It was weekend, delay expected so haven't heard back from them till now.

sbalikondwar (Sun, 07 Jun 2020 21:16:38 GMT):
Just thought of uploading the code to increase visibility of the work.

sbalikondwar (Sun, 07 Jun 2020 21:19:45 GMT):
Anyways sorry i was busy while you were online, it was Sunday had work, had to go to shop and buy some things for a special dinner :woo:

sbalikondwar (Sun, 07 Jun 2020 21:20:25 GMT):
Logging off for today, See you tomorrow.

seanyoung (Sun, 07 Jun 2020 21:41:27 GMT):
Great, I'll have a look first thing tomorrow morning. See you tomorrow!

sbalikondwar (Mon, 08 Jun 2020 09:49:52 GMT):
good afternoon

seanyoung (Mon, 08 Jun 2020 09:50:02 GMT):
good afternoon!

seanyoung (Mon, 08 Jun 2020 09:50:27 GMT):
I've had a first look. It's great to see lots of progress!

sbalikondwar (Mon, 08 Jun 2020 09:51:03 GMT):
yeah so the confusion was about sending the json rpc

seanyoung (Mon, 08 Jun 2020 09:51:34 GMT):
I'm lost. What was that?

sbalikondwar (Mon, 08 Jun 2020 09:52:36 GMT):
if you see here https://github.com/microsoft/vscode-languageserver-node/tree/master/jsonrpc

sbalikondwar (Mon, 08 Jun 2020 09:53:22 GMT):
in the readme file under heading there is code communication from client and server side

sbalikondwar (Mon, 08 Jun 2020 09:53:56 GMT):
as the next step i am using this snippets and observing if it works

seanyoung (Mon, 08 Jun 2020 09:56:33 GMT):
ok. Is that working now?

sbalikondwar (Mon, 08 Jun 2020 09:57:13 GMT):
no not completed, the snippet is used when both server and client are implemented in nodejs

sbalikondwar (Mon, 08 Jun 2020 09:57:38 GMT):
so had to use different the server side implementation

seanyoung (Mon, 08 Jun 2020 10:00:54 GMT):
ok. What server side implementation are you using?

sbalikondwar (Mon, 08 Jun 2020 10:02:41 GMT):
haven't used till now i thought to go with a simple python script for prototyping

seanyoung (Mon, 08 Jun 2020 10:02:57 GMT):
Great! That's a good idea.

sbalikondwar (Mon, 08 Jun 2020 10:02:58 GMT):
will let you know

seanyoung (Mon, 08 Jun 2020 10:03:30 GMT):
just out of interest, do you know what the requests look like when they go stdin of the server?

seanyoung (Mon, 08 Jun 2020 10:03:30 GMT):
just out of interest, do you know what the requests look like when they go to stdin of the server?

seanyoung (Mon, 08 Jun 2020 10:06:07 GMT):
anyway would be interesting to see when you get there

sbalikondwar (Mon, 08 Jun 2020 10:07:26 GMT):
i looked at code of rls, and it recieves code like

sbalikondwar (Mon, 08 Jun 2020 10:07:27 GMT):
impl MessageReader for StdioMsgReader { fn read_message(&self) -> Option { let stdin = io::stdin(); let mut locked = stdin.lock(); match read_message(&mut locked) { Ok(message) => Some(message), Err(err) => { debug!("{:?}", err); None } } } }

sbalikondwar (Mon, 08 Jun 2020 10:08:09 GMT):
the thing is, the documentation for vscode is vast and most of the part is not useful

sbalikondwar (Mon, 08 Jun 2020 10:08:32 GMT):
so it takes quite some time with searching stuff and then testing it

seanyoung (Mon, 08 Jun 2020 10:08:48 GMT):
Yes, I've noticed that too.

seanyoung (Mon, 08 Jun 2020 10:09:15 GMT):
And their vscode node modules are pretty big so reading their source code also isn't easy

sbalikondwar (Mon, 08 Jun 2020 10:10:09 GMT):
yeah and the typescript itself can surprise sometimes

sbalikondwar (Mon, 08 Jun 2020 10:10:25 GMT):
that's why i am not big fan of dynamic languages

sbalikondwar (Mon, 08 Jun 2020 10:10:25 GMT):
that's why i am not big fan of dynamic typed languages

sbalikondwar (Mon, 08 Jun 2020 10:11:07 GMT):
ok working it

sbalikondwar (Mon, 08 Jun 2020 10:11:07 GMT):
ok working on it

seanyoung (Mon, 08 Jun 2020 10:33:59 GMT):
I feel the same about dynamic languages.

sbalikondwar (Tue, 09 Jun 2020 21:16:22 GMT):
referring https://code.visualstudio.com/docs/editor/debugging#_launch-configurations for client and server interaction

sbalikondwar (Tue, 09 Jun 2020 21:16:31 GMT):
tried attaching client with server

sbalikondwar (Tue, 09 Jun 2020 21:18:14 GMT):

debug1.jpg

sbalikondwar (Tue, 09 Jun 2020 21:18:50 GMT):
working on the issues, should have something to do with server

sbalikondwar (Tue, 09 Jun 2020 21:19:07 GMT):
anyways logging off for today

sbalikondwar (Tue, 09 Jun 2020 21:19:13 GMT):
see you tomorrow

seanyoung (Wed, 10 Jun 2020 09:11:59 GMT):
Good afternoon

seanyoung (Wed, 10 Jun 2020 09:12:12 GMT):
Looks like it's trying to connect over tcp, not stdio.

seanyoung (Wed, 10 Jun 2020 09:13:38 GMT):
I'll have a go and see if I can make this work. Is the repo up to date?

sbalikondwar (Wed, 10 Jun 2020 09:14:28 GMT):
one min

sbalikondwar (Wed, 10 Jun 2020 09:14:33 GMT):
i'll update it

seanyoung (Wed, 10 Jun 2020 09:14:41 GMT):
thanks!

sbalikondwar (Wed, 10 Jun 2020 09:20:45 GMT):
done updated here https://github.com/Hyperion101010/sls

sbalikondwar (Wed, 10 Jun 2020 09:20:57 GMT):
from next time i will work on a seperate branch

sbalikondwar (Wed, 10 Jun 2020 09:21:07 GMT):
morning by the way

seanyoung (Wed, 10 Jun 2020 09:21:39 GMT):
So where are you exactly?

sbalikondwar (Wed, 10 Jun 2020 09:22:07 GMT):
some more contect?

seanyoung (Wed, 10 Jun 2020 09:22:42 GMT):
yes please :)

sbalikondwar (Wed, 10 Jun 2020 09:23:33 GMT):
yeah so when you clone the repo you need to do 1. npm install 2. open vscode 3. do ctrl+shift+b 4. on the command pallete do launch client and followed by launch server

sbalikondwar (Wed, 10 Jun 2020 09:24:26 GMT):
5. finally do ctrl+shift+p to open the command window and type 'hello' or 'send first code' as commands you will get some logs in the debug console

sbalikondwar (Wed, 10 Jun 2020 09:25:16 GMT):
are you asking about my time zone/country or progress of the project.

seanyoung (Wed, 10 Jun 2020 09:28:50 GMT):
Both really. How are things after the cyclone? Are things back to normal again? (well, coronavirus normal!)

sbalikondwar (Wed, 10 Jun 2020 09:30:58 GMT):
yeah everything is back to normal, very minor damage than expected. About the pandemic the cases are still on rise around 9-10k daily but given the population of India it is not alarming

sbalikondwar (Wed, 10 Jun 2020 09:31:41 GMT):
about project i finished the client and server side code (atleast the preliminary part) and was looking at attaching the server with the client

sbalikondwar (Wed, 10 Jun 2020 09:32:19 GMT):
i tried one example similar to the code i wrote, and it also throws the same error as i posted above before

sbalikondwar (Wed, 10 Jun 2020 09:32:51 GMT):
should be some minor line of code missing, or config problem

sbalikondwar (Wed, 10 Jun 2020 09:33:36 GMT):
do we have anyone in hyperledger community who has wrote a extension before ?

seanyoung (Wed, 10 Jun 2020 09:34:23 GMT):
I don't know of any vscode extensions in Hyperledger, unfortunately.

sbalikondwar (Wed, 10 Jun 2020 09:35:01 GMT):
ah, well i will drop a message on general once and i am sure i can get help over github or linkedin

sbalikondwar (Wed, 10 Jun 2020 09:35:45 GMT):
anyways i will try on my side first and in parallel send some queries to the people involved in extension writting task

seanyoung (Wed, 10 Jun 2020 09:35:59 GMT):
I'll have a look as well.

sbalikondwar (Wed, 10 Jun 2020 09:36:27 GMT):
slack community on vscode dev channel is quite inactive these days

sbalikondwar (Wed, 10 Jun 2020 09:36:35 GMT):
thanks @seanyoung

seanyoung (Wed, 10 Jun 2020 09:58:29 GMT):
This line https://github.com/Hyperion101010/sls/blob/master/package.json#L17 should be ``` "main": "./out/client/extension.js", ```

seanyoung (Wed, 10 Jun 2020 09:59:35 GMT):
I have "Launch Client" and "Attach to Server 29199" but no "Launch Server"

sbalikondwar (Wed, 10 Jun 2020 10:01:06 GMT):
Yes sorry it's attach to server

seanyoung (Wed, 10 Jun 2020 10:02:26 GMT):
The "Attach to Server 29199" action is an attach action, not launch. Also it connects to port 29299, not sure where that comes from.

sbalikondwar (Wed, 10 Jun 2020 10:03:04 GMT):
i was just testing for different ports

seanyoung (Wed, 10 Jun 2020 10:11:57 GMT):
So the client launches the server code. The communication between client and server is over stdio. So, the server is not listening on a tcp port. I don't see how attaching via port is going to work.

sbalikondwar (Wed, 10 Jun 2020 10:12:30 GMT):
well the server side code is also using streamreader and streamwriter

sbalikondwar (Wed, 10 Jun 2020 10:12:54 GMT):
but i reffered an example extension and there it was using ports for attaching

sbalikondwar (Wed, 10 Jun 2020 10:13:16 GMT):
will search and send it asap

seanyoung (Wed, 10 Jun 2020 10:14:26 GMT):
That would be great, thanks. If you mean the streamreader and streamwriter: ``` new rpc.StreamMessageReader(process.stdout), new rpc.StreamMessageWriter(process.stdin) ``` Then these work via stdio, not tcp

seanyoung (Wed, 10 Jun 2020 10:15:30 GMT):
Lastly what are you trying to achieve with "Attach to server". The server will be replaced with solang anyway.

sbalikondwar (Wed, 10 Jun 2020 10:16:06 GMT):
i was testing to see the end to end communication

seanyoung (Wed, 10 Jun 2020 10:16:28 GMT):
yes, that does make sense

seanyoung (Wed, 10 Jun 2020 10:19:09 GMT):
The server is started with --inspect=6009

seanyoung (Wed, 10 Jun 2020 10:19:34 GMT):
It seems to make sense that the attach to server with inspector protocol should match that

seanyoung (Wed, 10 Jun 2020 10:30:07 GMT):
https://github.com/Hyperion101010/sls/blob/master/src/client/extension.ts#L56 Should be ``` const serverModule = context.asAbsolutePath(path.join('out', 'server', 'server.js')); ```

seanyoung (Wed, 10 Jun 2020 10:30:21 GMT):
otherwise the server module path is wrong (at least for me)

seanyoung (Wed, 10 Jun 2020 10:30:38 GMT):
however it still does not seem to launch the server

sbalikondwar (Wed, 10 Jun 2020 10:49:59 GMT):
hi there

sbalikondwar (Wed, 10 Jun 2020 10:50:04 GMT):
this was the example https://github.com/microsoft/vscode-extension-samples/tree/master/lsp-user-input-sample

sbalikondwar (Wed, 10 Jun 2020 10:50:17 GMT):
which used attach server i reffered

seanyoung (Wed, 10 Jun 2020 10:56:49 GMT):
I think I just got it working: https://github.com/Hyperion101010/sls/pull/1

sbalikondwar (Wed, 10 Jun 2020 10:57:36 GMT):
ok i will pull and check

seanyoung (Wed, 10 Jun 2020 11:00:13 GMT):
so socket communication usually means over tcp. in this case ipc means stdio

sbalikondwar (Wed, 10 Jun 2020 11:10:08 GMT):
i am always on the sender side while sending PR's, does git pull also fetch your changes in respective branch?

sbalikondwar (Wed, 10 Jun 2020 11:13:49 GMT):
no i should clone and check or merge the PR then check

seanyoung (Wed, 10 Jun 2020 11:19:40 GMT):
I'm confused. Do you have local changes which you would like to merge?

sbalikondwar (Wed, 10 Jun 2020 11:21:15 GMT):
no i as i see that the incoming PR is not on my origin i should be using git fetch origin pull/1/seanyoung:server-start

seanyoung (Wed, 10 Jun 2020 11:22:05 GMT):
You can add a remote to your repo:

seanyoung (Wed, 10 Jun 2020 11:22:12 GMT):
git remote add sean https://github.com/seanyoung/sls

seanyoung (Wed, 10 Jun 2020 11:22:15 GMT):
git remote update sean

seanyoung (Wed, 10 Jun 2020 11:22:38 GMT):
then see ``git log -p sean/server-start``

seanyoung (Wed, 10 Jun 2020 11:22:38 GMT):
then see the commit with `git log -p sean/server-start`

seanyoung (Wed, 10 Jun 2020 11:23:01 GMT):
or merge with git merge sean/server-start

sbalikondwar (Wed, 10 Jun 2020 11:23:45 GMT):
thanks

sbalikondwar (Wed, 10 Jun 2020 11:38:34 GMT):
well looks like there is some problem on my side

sbalikondwar (Wed, 10 Jun 2020 11:38:40 GMT):
i tried the changes

sbalikondwar (Wed, 10 Jun 2020 11:38:48 GMT):
and got the same error as before

sbalikondwar (Wed, 10 Jun 2020 11:39:10 GMT):
what do you observe on your end? a screenshot will be helpful

sbalikondwar (Wed, 10 Jun 2020 11:40:31 GMT):
the client and server run for some time lets say 5 sec and then the timeout happens

sbalikondwar (Wed, 10 Jun 2020 11:41:23 GMT):
wait one min let me recheck

seanyoung (Wed, 10 Jun 2020 11:47:43 GMT):
so when you run "Launch Client", the server process should be running.

seanyoung (Wed, 10 Jun 2020 11:47:53 GMT):
you can check this with `ps axfwwww | grep sls`

seanyoung (Wed, 10 Jun 2020 11:48:01 GMT):
what output do you get?

seanyoung (Wed, 10 Jun 2020 11:55:13 GMT):
I'm trying to think what screenshot would be most helpful

sbalikondwar (Wed, 10 Jun 2020 11:55:27 GMT):
wait i am trying

sbalikondwar (Wed, 10 Jun 2020 12:00:56 GMT):
perfect

sbalikondwar (Wed, 10 Jun 2020 12:01:08 GMT):
one min will post some screenshots

sbalikondwar (Wed, 10 Jun 2020 12:01:32 GMT):

Screenshot from 2020-06-10 17-29-46.png

sbalikondwar (Wed, 10 Jun 2020 12:01:41 GMT):
@seanyoung is this same as your side ?

seanyoung (Wed, 10 Jun 2020 12:02:09 GMT):
[sean@xywoleh sls]$ ps axfwwww | grep sls 23061 pts/2 S+ 0:00 | | \_ grep --color=auto sls 22894 pts/4 Sl+ 0:06 | \_ node /home/sean/git/sls/node_modules/.bin/tsc -watch -p ./ 22997 ? Sl 0:00 | \_ /usr/share/code/code --nolazy --inspect=6009 /home/sean/git/sls/out/server/server.js --node-ipc --clientProcessId=22940

sbalikondwar (Wed, 10 Jun 2020 12:02:10 GMT):
in the callstack you can see two instances

seanyoung (Wed, 10 Jun 2020 12:02:58 GMT):
Looks like your server did not start

sbalikondwar (Wed, 10 Jun 2020 12:02:59 GMT):
ok i need to redo it

sbalikondwar (Wed, 10 Jun 2020 12:03:25 GMT):
yes started

seanyoung (Wed, 10 Jun 2020 12:03:47 GMT):
So, you can also test your server stand-alone: `node out/server/server.js`

sbalikondwar (Wed, 10 Jun 2020 12:03:59 GMT):

Screenshot from 2020-06-10 17-33-18.png

sbalikondwar (Wed, 10 Jun 2020 12:04:24 GMT):
fixed then?

seanyoung (Wed, 10 Jun 2020 12:04:27 GMT):
strange, you seem to have two running

seanyoung (Wed, 10 Jun 2020 12:04:39 GMT):
not sure if two is better than one in this instance

sbalikondwar (Wed, 10 Jun 2020 12:04:54 GMT):
well i launched it twice

seanyoung (Wed, 10 Jun 2020 12:04:59 GMT):
ok :)

sbalikondwar (Wed, 10 Jun 2020 12:05:02 GMT):
so my mistake

sbalikondwar (Wed, 10 Jun 2020 12:05:18 GMT):
ok then will merge it

seanyoung (Wed, 10 Jun 2020 12:05:29 GMT):
can you attach to server?

sbalikondwar (Wed, 10 Jun 2020 12:05:52 GMT):
yes

sbalikondwar (Wed, 10 Jun 2020 12:06:06 GMT):
that was the 2 instance

seanyoung (Wed, 10 Jun 2020 12:06:06 GMT):
great

sbalikondwar (Wed, 10 Jun 2020 12:06:37 GMT):
so i was thinking maybe we can have a meet tommorow ?

sbalikondwar (Wed, 10 Jun 2020 12:07:01 GMT):
I would like to discuss the doubts about further plans

seanyoung (Wed, 10 Jun 2020 12:07:04 GMT):
Of course!

seanyoung (Wed, 10 Jun 2020 12:07:09 GMT):
What time suits you?

sbalikondwar (Wed, 10 Jun 2020 12:07:31 GMT):
its better if we do straight audio rather lengthy typing

sbalikondwar (Wed, 10 Jun 2020 12:07:39 GMT):
what time suits you?

seanyoung (Wed, 10 Jun 2020 12:08:17 GMT):
ehm I have something at 1pm and 3pm (BST) otherwise anytime

sbalikondwar (Wed, 10 Jun 2020 12:08:49 GMT):
how is Search Results Local Time Conversion 4:00 pm Wednesday, Indian Standard Time (IST) is 11:30 am Wednesday, in United Kingdom

sbalikondwar (Wed, 10 Jun 2020 12:09:16 GMT):
oh make it thursday

sbalikondwar (Wed, 10 Jun 2020 12:10:00 GMT):
let me know, tea time!

seanyoung (Wed, 10 Jun 2020 12:10:25 GMT):
Sure, that's fine!

seanyoung (Wed, 10 Jun 2020 12:10:41 GMT):
Enjoy your tea

sbalikondwar (Wed, 10 Jun 2020 16:35:40 GMT):
back

sbalikondwar (Wed, 10 Jun 2020 16:37:07 GMT):
well for today i will work on looking on the plan side

sbalikondwar (Wed, 10 Jun 2020 16:37:44 GMT):
min(the person incharge) said we need to give doc till this weekend for hyperledger mentorship

sbalikondwar (Wed, 10 Jun 2020 16:37:44 GMT):
min(the person incharge) said we need to give doc till this weekend for hyperledger mentorship some plan and all

sbalikondwar (Wed, 10 Jun 2020 16:38:51 GMT):
till tomorrow will list out some points that can be discussed in the meet

seanyoung (Wed, 10 Jun 2020 16:45:00 GMT):
Ah yes, good point

sbalikondwar (Wed, 10 Jun 2020 17:01:24 GMT):
ok then logging off for today will work sometime later

sbalikondwar (Wed, 10 Jun 2020 17:01:53 GMT):
good day

seanyoung (Wed, 10 Jun 2020 17:19:44 GMT):
good day!

sbalikondwar (Thu, 11 Jun 2020 09:57:16 GMT):
good afternoon

seanyoung (Thu, 11 Jun 2020 09:57:31 GMT):
Good afternoon!

sbalikondwar (Thu, 11 Jun 2020 09:57:33 GMT):
@seanyoung i will list out thing on the sls proposal

sbalikondwar (Thu, 11 Jun 2020 09:57:46 GMT):
and will discuss them there

sbalikondwar (Thu, 11 Jun 2020 09:57:53 GMT):
does it sound comfortable?

seanyoung (Thu, 11 Jun 2020 09:58:12 GMT):
What do you mean by thing?

sbalikondwar (Thu, 11 Jun 2020 09:58:47 GMT):
i mean all the required tasks, deliverables that Min wants atleast to give idea

sbalikondwar (Thu, 11 Jun 2020 09:58:56 GMT):
have you recieved the mail?

seanyoung (Thu, 11 Jun 2020 10:02:06 GMT):
I got an email from Min Yu listing what's needed by June 15th (Project Plan). Is that what you mean?

sbalikondwar (Thu, 11 Jun 2020 10:02:12 GMT):
yes

sbalikondwar (Thu, 11 Jun 2020 10:02:34 GMT):
so it means she needs details about the entire plan till june 15th

sbalikondwar (Thu, 11 Jun 2020 10:03:12 GMT):
atleast what we are looking at and its natural some things can change

seanyoung (Thu, 11 Jun 2020 10:15:05 GMT):
Yes, the sls proposal page is fine. Thank you for putting this together

sbalikondwar (Thu, 11 Jun 2020 10:15:31 GMT):
will discuss same and list out some things in the meet

sbalikondwar (Thu, 11 Jun 2020 10:15:44 GMT):
in 15 min right?

seanyoung (Thu, 11 Jun 2020 10:19:13 GMT):
Yep

seanyoung (Thu, 11 Jun 2020 10:24:19 GMT):
Actually the instructions I have say it has to be a "separate daughter page", unfortunately

seanyoung (Thu, 11 Jun 2020 10:24:19 GMT):
Actually the instructions I have say it has to be a "separate daughter page" of the project wiki.

sbalikondwar (Thu, 11 Jun 2020 10:32:26 GMT):
https://docs.google.com/document/d/1UNuxfm-k6J3AAmlP8dWqxH13LoNwKrniWezP2SZlG30/edit?usp=sharing

seanyoung (Thu, 11 Jun 2020 10:40:52 GMT):
You've dropped from the call

seanyoung (Thu, 11 Jun 2020 10:42:06 GMT):
For documentation it would be good if some steps are listed in https://solang.readthedocs.io/en/latest/

sbalikondwar (Fri, 12 Jun 2020 10:44:24 GMT):
good afternoon @seanyoung

sbalikondwar (Fri, 12 Jun 2020 10:44:44 GMT):
i got one mail from Min about the reference resource for our proposal doc

sbalikondwar (Fri, 12 Jun 2020 10:44:46 GMT):
https://wiki.hyperledger.org/pages/viewpage.action?pageId=31202438

sbalikondwar (Fri, 12 Jun 2020 10:45:31 GMT):
https://wiki.lfnetworking.org/display/LN/Project+Plan+-+ONAP+ETSI+NFV+APIs+conformance+test+for+OVP

sbalikondwar (Fri, 12 Jun 2020 10:48:08 GMT):
we already discussed the points so will sit around night today and will update the pages

sbalikondwar (Fri, 12 Jun 2020 10:54:20 GMT):
working on p1 and then rust server impl

seanyoung (Fri, 12 Jun 2020 11:36:27 GMT):
good afternoon

seanyoung (Fri, 12 Jun 2020 11:36:38 GMT):
ok, please let me know if I can do anything

seanyoung (Fri, 12 Jun 2020 11:37:06 GMT):
I'm working on the solang refactor for language server. It's taking some time.

sbalikondwar (Fri, 12 Jun 2020 11:38:22 GMT):
yeah sure

sbalikondwar (Fri, 12 Jun 2020 14:05:16 GMT):
@seanyoung are you available on weekend ?

sbalikondwar (Fri, 12 Jun 2020 14:05:28 GMT):
i mean if possible just to review the doc

seanyoung (Fri, 12 Jun 2020 14:05:45 GMT):
Yep, I'm in lockdown, not going anywhere :-)

sbalikondwar (Fri, 12 Jun 2020 14:05:58 GMT):
great, me too in lockdown

sbalikondwar (Fri, 12 Jun 2020 14:06:36 GMT):
ok then i will take some time off have some dinner then sit back on plan and let you know

sbalikondwar (Fri, 12 Jun 2020 14:07:20 GMT):
today i was just checking the syntax highlighting part

sbalikondwar (Fri, 12 Jun 2020 14:07:37 GMT):
worked good while i was writing a sample solidity code

sbalikondwar (Fri, 12 Jun 2020 14:08:08 GMT):
so you contacted with rjones about the github repo we were going to have for our project

seanyoung (Fri, 12 Jun 2020 14:09:07 GMT):
Not yet. What do you think it should be called?

sbalikondwar (Fri, 12 Jun 2020 14:10:49 GMT):
Slang solidity or sls or Solidity server , i am not good with giving names :sweat_smile:

sbalikondwar (Fri, 12 Jun 2020 14:11:29 GMT):
anyways see you then, good day!

seanyoung (Fri, 12 Jun 2020 14:11:48 GMT):
solang-vscode?

sbalikondwar (Fri, 12 Jun 2020 14:11:53 GMT):
great

seanyoung (Fri, 12 Jun 2020 14:12:02 GMT):
have a good evening!

sbalikondwar (Fri, 12 Jun 2020 14:12:07 GMT):
you too.

sbalikondwar (Sat, 13 Jun 2020 11:29:58 GMT):
@seanyoung i created a project plan please check here https://wiki.hyperledger.org/pages/viewpage.action?pageId=31202927

seanyoung (Sat, 13 Jun 2020 11:30:14 GMT):
I'll have a look, thanks!

sbalikondwar (Sat, 13 Jun 2020 11:30:18 GMT):
ok

seanyoung (Sat, 13 Jun 2020 12:59:44 GMT):
I think it looks good. I made a minor edit, you should be able to see that.

sbalikondwar (Sat, 13 Jun 2020 15:07:39 GMT):
where was the edit by the way

sbalikondwar (Sat, 13 Jun 2020 15:16:42 GMT):
anyways i will forward it to Min and take a final review

sbalikondwar (Sat, 13 Jun 2020 15:25:26 GMT):
@seanyoung dinner time! see you later

sbalikondwar (Sat, 13 Jun 2020 15:25:31 GMT):
good day.

seanyoung (Sun, 14 Jun 2020 09:12:52 GMT):
Good afternoon @sbalikondwar Sorry I missed your messages yesterday. You can see the history of the page here: https://wiki.hyperledger.org/pages/viewpreviousversions.action?pageId=31202927

sbalikondwar (Sun, 14 Jun 2020 10:44:38 GMT):
ok

sbalikondwar (Sun, 14 Jun 2020 10:44:43 GMT):
good afternoon

sbalikondwar (Sun, 14 Jun 2020 10:46:15 GMT):
Ah minor mistakes :sweat_smile:

seanyoung (Sun, 14 Jun 2020 10:49:52 GMT):
Any feedback from Min yet?

sbalikondwar (Sun, 14 Jun 2020 10:51:40 GMT):
No, I mailed her yesterday and waiting for the response

sbalikondwar (Sun, 14 Jun 2020 10:52:33 GMT):
looking at the examples for refferal https://wiki.hyperledger.org/pages/viewpage.action?pageId=31202438 i think our plan is fine

sbalikondwar (Sun, 14 Jun 2020 10:53:18 GMT):
but i have given her write access so she can change whenever possible

sbalikondwar (Sun, 14 Jun 2020 10:54:44 GMT):
i forgot to add you on cc, but i have forwarded a copy to you as well.

sbalikondwar (Sun, 14 Jun 2020 10:54:44 GMT):
i forgot to add you on cc, but i have forwarded a copy to you.

seanyoung (Sun, 14 Jun 2020 11:02:58 GMT):
got it, thanks. Let's just wait and see. Looks good to me

sbalikondwar (Sun, 14 Jun 2020 11:09:02 GMT):
ok

sbalikondwar (Sun, 14 Jun 2020 11:10:19 GMT):
according to the plan, I will now look on the server side to receive messages from clients in rust

sbalikondwar (Sun, 14 Jun 2020 11:11:35 GMT):
Anyways its sunday, i will overview today and let you know tomorrow

sbalikondwar (Sun, 14 Jun 2020 11:11:44 GMT):
enjoy

sbalikondwar (Mon, 15 Jun 2020 08:35:51 GMT):
good afternoon

sbalikondwar (Mon, 15 Jun 2020 08:36:25 GMT):
looking in rls-ipc of rls for implementation of server using Rust

seanyoung (Mon, 15 Jun 2020 08:36:44 GMT):
good afternoon

seanyoung (Mon, 15 Jun 2020 08:39:24 GMT):
Sorry was that a question?

sbalikondwar (Mon, 15 Jun 2020 08:40:11 GMT):
no, i was just letting you know what i am looking at

sbalikondwar (Mon, 15 Jun 2020 08:40:11 GMT):
no, i was just letting you know what i am working on

sbalikondwar (Mon, 15 Jun 2020 08:40:11 GMT):
no, i was just letting you know what i am working/understanding on

seanyoung (Mon, 15 Jun 2020 08:40:57 GMT):
ok

seanyoung (Mon, 15 Jun 2020 08:41:02 GMT):
you could also start with https://github.com/rust-analyzer/lsp-server

sbalikondwar (Mon, 15 Jun 2020 08:41:24 GMT):
yeah helpful thanks

sbalikondwar (Mon, 15 Jun 2020 14:59:41 GMT):
there is a gotodefinition example in the lsp-server so i am trying it out

seanyoung (Mon, 15 Jun 2020 15:00:00 GMT):
great

sbalikondwar (Mon, 15 Jun 2020 15:00:18 GMT):
dinner time! here, will work sometime later.

sbalikondwar (Mon, 15 Jun 2020 15:00:41 GMT):
by the way how is the situation there, i saw there are protests taking place

seanyoung (Mon, 15 Jun 2020 15:02:25 GMT):
Everything is fine, there were some protests but apart from some bad apples the protests have been good

sbalikondwar (Mon, 15 Jun 2020 15:03:27 GMT):
oh ok, this year will be surely worth remembering :grin:

seanyoung (Mon, 15 Jun 2020 15:03:56 GMT):
yes, that's true :)

seanyoung (Mon, 15 Jun 2020 15:04:13 GMT):
How are things for you?

sbalikondwar (Mon, 15 Jun 2020 15:05:31 GMT):
Good, we are having a timely monsoon and virus is slowly rising but we hope that the peak comes(in Nov) after we have a vaccine

sbalikondwar (Mon, 15 Jun 2020 15:07:05 GMT):
anyways got to go for dinner!, you too should be having tea time

sbalikondwar (Mon, 15 Jun 2020 15:07:08 GMT):
see you then

seanyoung (Mon, 15 Jun 2020 15:07:37 GMT):
see you tomorrow

seanyoung (Mon, 15 Jun 2020 16:14:27 GMT):
BTW this is what I've been working on: https://github.com/hyperledger-labs/solang/pull/208 Not finished yet but should give you a fully resolved AST.

sbalikondwar (Mon, 15 Jun 2020 16:25:13 GMT):
Ok

sbalikondwar (Tue, 16 Jun 2020 09:58:01 GMT):
good afternoon

seanyoung (Tue, 16 Jun 2020 09:58:15 GMT):
good afternoon

sbalikondwar (Tue, 16 Jun 2020 09:58:24 GMT):
got reply from Min, she told that the proposed plan looks good

seanyoung (Tue, 16 Jun 2020 09:58:41 GMT):
That's great, something less to worry about :)

sbalikondwar (Tue, 16 Jun 2020 09:58:48 GMT):
yeah

seanyoung (Tue, 16 Jun 2020 09:59:25 GMT):
Where are you at with the language server? Anything I can help with?

sbalikondwar (Tue, 16 Jun 2020 10:00:26 GMT):
i am working with the example, for now. After the example works as expected then i can begin writing code following the docs and example

sbalikondwar (Tue, 16 Jun 2020 10:01:00 GMT):
will let you know if i hit some hurdles

seanyoung (Tue, 16 Jun 2020 10:09:58 GMT):
Ok. How is your rust?

seanyoung (Tue, 16 Jun 2020 10:10:26 GMT):
It can be tricky at first. The borrow checker is something hard to get your head round.

seanyoung (Tue, 16 Jun 2020 10:10:38 GMT):
At least, it took me quite some time

sbalikondwar (Tue, 16 Jun 2020 10:15:29 GMT):
to an intermediate level

sbalikondwar (Tue, 16 Jun 2020 10:16:24 GMT):
i can pick in no time, still can read further if required

sbalikondwar (Tue, 16 Jun 2020 10:16:56 GMT):
yes borrow and lifetimes are quite confusing

sbalikondwar (Tue, 16 Jun 2020 10:17:12 GMT):
but debugger is there for help

seanyoung (Tue, 16 Jun 2020 10:18:43 GMT):
debugger won't help there. This is a compile-time error. Anyway, just something to be aware off. I'm here to help so let me know if there is anything I can do.

sbalikondwar (Tue, 16 Jun 2020 10:19:54 GMT):
yes, ok

seanyoung (Wed, 17 Jun 2020 12:23:14 GMT):
Good afternoon @sbalikondwar

seanyoung (Wed, 17 Jun 2020 12:23:58 GMT):
Just wondering if you got the lsp-server example running.

sbalikondwar (Wed, 17 Jun 2020 13:46:05 GMT):
hi there, good afternoon

sbalikondwar (Wed, 17 Jun 2020 13:47:56 GMT):
I was using the wrong approach i was changing the server.ts file and looking for receiving the message, but i in morning found that i need to change serveroptions to run the lsp-server executable

sbalikondwar (Wed, 17 Jun 2020 13:48:05 GMT):
just a min i will post the changes

seanyoung (Wed, 17 Jun 2020 13:48:28 GMT):
Great, looking forward to it

sbalikondwar (Wed, 17 Jun 2020 13:49:10 GMT):
much like

sbalikondwar (Wed, 17 Jun 2020 13:49:11 GMT):
const rn: Executable = { command: 'cargo run', args: ['--example', 'goto_def'], options: { cwd: '/home/hyperion/intern/hyperledger/sls/practice/lsp-server' }, //transport: TransportKind.stdio }; const serverOptions: ServerOptions = rn;

sbalikondwar (Wed, 17 Jun 2020 22:09:32 GMT):
hi there

sbalikondwar (Wed, 17 Jun 2020 22:10:15 GMT):
i know it got late today, from some surfing and lot of reading i find that the server gets initialized

sbalikondwar (Wed, 17 Jun 2020 22:10:33 GMT):
like this screenshot look in terminal

sbalikondwar (Wed, 17 Jun 2020 22:13:34 GMT):

Screenshot from 2020-06-18 03-42-03.png

sbalikondwar (Wed, 17 Jun 2020 22:13:40 GMT):

Screenshot from 2020-06-18 03-41-37.png

sbalikondwar (Wed, 17 Jun 2020 22:14:42 GMT):
@seanyoung if you can look in the host extension vscode window output, it runs cargo server and it goes into goto_def listening mode after reading input from stdio

seanyoung (Wed, 17 Jun 2020 22:16:38 GMT):
Great!

seanyoung (Wed, 17 Jun 2020 22:17:29 GMT):
Would you mind pushing that to your sls repo please?

sbalikondwar (Wed, 17 Jun 2020 22:17:37 GMT):
already done

sbalikondwar (Wed, 17 Jun 2020 22:17:45 GMT):
one change is remaining though

seanyoung (Wed, 17 Jun 2020 22:17:47 GMT):
Nice to see that running

sbalikondwar (Wed, 17 Jun 2020 22:17:51 GMT):
just a sec

sbalikondwar (Wed, 17 Jun 2020 22:21:25 GMT):
ok done

sbalikondwar (Wed, 17 Jun 2020 22:21:25 GMT):
ok done, will continue tomorrow

sbalikondwar (Wed, 17 Jun 2020 22:21:59 GMT):
very late for today heading to bed, see you good night

seanyoung (Wed, 17 Jun 2020 22:23:50 GMT):
It is very late! Good night

sbalikondwar (Thu, 18 Jun 2020 13:10:28 GMT):
hi there, good afternoon

seanyoung (Thu, 18 Jun 2020 13:10:43 GMT):
hello

seanyoung (Thu, 18 Jun 2020 13:10:46 GMT):
afternoon

seanyoung (Thu, 18 Jun 2020 13:11:36 GMT):
So the language server on the typescript side is talking to the rust side, that's good

sbalikondwar (Thu, 18 Jun 2020 13:16:13 GMT):
partly i can say, so the server is interfaced with client. When the client is run, the server is also launched as the lsp and it starts recieving from stdio. I am working further to write some implementation in rust to add some feature request and response.

sbalikondwar (Thu, 18 Jun 2020 13:16:34 GMT):
lets do a meet tomorrow

seanyoung (Thu, 18 Jun 2020 13:17:15 GMT):
that's good, let me know when you'd like to meet tomorrow.

sbalikondwar (Thu, 18 Jun 2020 13:18:28 GMT):
Search Results Local Time Conversion 2:00 pm Thursday, Indian Standard Time (IST) is 9:30 am Thursday, in United Kingdom

seanyoung (Thu, 18 Jun 2020 13:18:46 GMT):
yep that's fine

sbalikondwar (Thu, 18 Jun 2020 13:21:22 GMT):
I will share the progress and by then I am sure will be ready to then completely work on the rust side. According to the plan will discuss things regarding this server and client interfacing and following work which can be some tests

seanyoung (Thu, 18 Jun 2020 13:22:48 GMT):
sounds good

sbalikondwar (Thu, 18 Jun 2020 13:23:33 GMT):
ok

seanyoung (Thu, 18 Jun 2020 13:25:14 GMT):
I think it will be useful if solang has a ``--emit ast`` option. Then, you can see the ast which will help you write the language server. I'm not sure what the ast should look like. It could be just some json like solc but it's hard to read.

seanyoung (Thu, 18 Jun 2020 13:25:14 GMT):
I think it will be useful if solang has a `--emit ast` option. Then, you can see the ast which will help you write the language server. I'm not sure what the ast should look like. It could be just some json like solc but it's hard to read.

sbalikondwar (Thu, 18 Jun 2020 13:26:50 GMT):
I have to read on it, I thought it was using the crates shall I answer it by tomorrow in meet ?

seanyoung (Thu, 18 Jun 2020 13:35:28 GMT):
Yes, you're right it would work via crates. This would be just a debugging tool. Don't worry about it, I'm just struggling how to make tree look readable in text format.

seanyoung (Thu, 18 Jun 2020 13:35:28 GMT):
Yes, you're right it would work via crates. This would be just a debugging tool. Don't worry about it, I'm just struggling how to make trees look readable in text format.

sbalikondwar (Thu, 18 Jun 2020 13:35:46 GMT):
ok great

sbalikondwar (Fri, 19 Jun 2020 08:28:04 GMT):
good afternoon

seanyoung (Fri, 19 Jun 2020 08:28:20 GMT):
good afternoon

sbalikondwar (Fri, 19 Jun 2020 10:34:36 GMT):
https://github.com/rust-analyzer/lsp-server/issues/16

sbalikondwar (Fri, 19 Jun 2020 10:48:03 GMT):
got some leads which i will look

seanyoung (Fri, 19 Jun 2020 10:59:27 GMT):
hmm that is disappointing

seanyoung (Fri, 19 Jun 2020 11:06:39 GMT):
having said that, tower-lsp does look promising

seanyoung (Fri, 19 Jun 2020 11:18:04 GMT):
Interesting it can do async over stdio. I thought it would be synchronous, but I guess there is some sort of interleaving protocol.

sbalikondwar (Fri, 19 Jun 2020 11:34:13 GMT):
ok looks like tower-lsp can recieve requests from client side

sbalikondwar (Fri, 19 Jun 2020 11:34:36 GMT):

Screenshot from 2020-06-19 17-03-46.png

seanyoung (Fri, 19 Jun 2020 11:35:00 GMT):
Nice!

sbalikondwar (Fri, 19 Jun 2020 11:35:05 GMT):
much better than lsp-server

sbalikondwar (Fri, 19 Jun 2020 11:35:22 GMT):
which was only initialising the server and having problems with requests

seanyoung (Fri, 19 Jun 2020 11:38:18 GMT):
Thank you for todays meeting, that was useful. I think it might be good to do this on a weekly basis. What do you think and if you agree, when would be suitable?

sbalikondwar (Fri, 19 Jun 2020 11:40:07 GMT):
tested save and close functions as well and it works great

sbalikondwar (Fri, 19 Jun 2020 11:40:25 GMT):
[2020-06-19T11:39:04Z ERROR tower_lsp] Got a textDocument/hover request, but it is not implemented [Error - 5:09:04 pm] Request textDocument/hover failed. Message: Method not found Code: -32601 [Info - 5:09:09 pm] file saved! [Info - 5:09:20 pm] file closed!

sbalikondwar (Fri, 19 Jun 2020 11:41:45 GMT):
usually 2pm - 7 pm IST any day of the week

sbalikondwar (Fri, 19 Jun 2020 11:42:18 GMT):
let me know

sbalikondwar (Fri, 19 Jun 2020 11:42:36 GMT):
should we keep it on wednesdays?

seanyoung (Fri, 19 Jun 2020 11:42:51 GMT):
Wednesday is good for me

sbalikondwar (Fri, 19 Jun 2020 11:43:00 GMT):
alright!

seanyoung (Fri, 19 Jun 2020 11:43:25 GMT):
Getting those requests working is good news, I'm happy about that

sbalikondwar (Fri, 19 Jun 2020 11:43:48 GMT):
yeah me too, atleast this repo has some docs for reference

sbalikondwar (Fri, 19 Jun 2020 15:15:39 GMT):
going to head for dinner, good day @seanyoung

seanyoung (Fri, 19 Jun 2020 15:19:05 GMT):
good evening!

miguel (Sun, 21 Jun 2020 19:53:38 GMT):
Has joined the channel.

miguel (Sun, 21 Jun 2020 19:53:38 GMT):
Hi everyone, I'm Miguel

miguel (Sun, 21 Jun 2020 19:53:59 GMT):
Currently doing `casting from bytesN to bytes and vice versa should be possible #158`

miguel (Sun, 21 Jun 2020 19:55:30 GMT):
I'm getting to know the project a little more, trying to do the flipper contract on the documentation, I was able to compile but I'm not sure how to test it

seanyoung (Sun, 21 Jun 2020 20:17:49 GMT):
@miguel you can run `cargo test` or use the contact with Hyperledger Burrow or Parity Substrate.

seanyoung (Sun, 21 Jun 2020 20:18:19 GMT):
Follow the documentation in Burrow or Substrate to see how to use those.

seanyoung (Sun, 21 Jun 2020 20:18:34 GMT):
It is probably easier to use the built-in tests for your purposes

sbalikondwar (Mon, 22 Jun 2020 08:33:51 GMT):
hi there

sbalikondwar (Mon, 22 Jun 2020 08:34:29 GMT):
follow up on the tower-lsp, in parallel I tried to implement a minimal hover ability

sbalikondwar (Mon, 22 Jun 2020 08:34:29 GMT):
follow up on the tower-lsp, in parallel I tried to experiment with a minimal hover ability

sbalikondwar (Mon, 22 Jun 2020 08:39:36 GMT):

hoveredit.png

sbalikondwar (Mon, 22 Jun 2020 08:39:46 GMT):
sitting for lunch, will be back in an hour

sbalikondwar (Mon, 22 Jun 2020 10:52:22 GMT):
alright, so today I did implement a hover functionality, on the server side i wrote a sample message and i can observe that when i hover over the code the server responses with a special message from server

sbalikondwar (Mon, 22 Jun 2020 10:52:54 GMT):
Now I can confirm the server and client can fully communicate with each other

sbalikondwar (Mon, 22 Jun 2020 10:53:28 GMT):
Next steps would be beautification and handling errors

sbalikondwar (Mon, 22 Jun 2020 10:53:42 GMT):
tower-lsp is very helpful

sbalikondwar (Mon, 22 Jun 2020 10:55:27 GMT):

hover2.png

sbalikondwar (Mon, 22 Jun 2020 10:55:50 GMT):
if you compare this pic with the later then this has no error message of hover implementation cause it is already implemented

seanyoung (Mon, 22 Jun 2020 18:52:09 GMT):
Very nice!

sbalikondwar (Mon, 22 Jun 2020 18:52:27 GMT):
Good evening

seanyoung (Mon, 22 Jun 2020 18:52:39 GMT):
Good evening

sbalikondwar (Mon, 22 Jun 2020 18:52:51 GMT):
I was away for this weekend, but it's already late here

seanyoung (Mon, 22 Jun 2020 18:53:20 GMT):
Great progress. You're sending the message from the rust server?

sbalikondwar (Mon, 22 Jun 2020 18:53:27 GMT):
Yes

seanyoung (Mon, 22 Jun 2020 18:53:51 GMT):
That's great.

sbalikondwar (Mon, 22 Jun 2020 18:53:51 GMT):
We can implement more kind of messages from server in future

sbalikondwar (Mon, 22 Jun 2020 18:55:10 GMT):
I will upload code tomorrow, it's better to understand from there. For now I might head to bed

sbalikondwar (Mon, 22 Jun 2020 18:55:19 GMT):
See you tomorrow

seanyoung (Mon, 22 Jun 2020 18:55:33 GMT):
Yes, it is very late for you! See you tomorrow

sbalikondwar (Tue, 23 Jun 2020 10:39:37 GMT):
good afternoon

sbalikondwar (Tue, 23 Jun 2020 10:40:08 GMT):
did upload on p1_work branch

sbalikondwar (Tue, 23 Jun 2020 10:58:33 GMT):
looking here https://code.visualstudio.com/api/working-with-extensions/testing-extension

sbalikondwar (Tue, 23 Jun 2020 10:58:33 GMT):
looking here https://code.visualstudio.com/api/working-with-extensions/testing-extension for test implementation

seanyoung (Tue, 23 Jun 2020 11:02:03 GMT):
Good afternoon. That's great, looks very useful

seanyoung (Tue, 23 Jun 2020 13:39:41 GMT):
Hi @sbalikondwar, if you have time it would be great to do a weekly catchup tomorrow. What time would suit?

sbalikondwar (Tue, 23 Jun 2020 14:15:40 GMT):
anytime from 2PM IST TO 6PM IST

sbalikondwar (Tue, 23 Jun 2020 14:15:46 GMT):
what is favourable for you

sbalikondwar (Tue, 23 Jun 2020 14:16:10 GMT):
sorry for the delay I like to go for a short cycling stroll after my tea in evening

seanyoung (Tue, 23 Jun 2020 14:17:04 GMT):
I really don't mind what time. How about 5PM IST so 12:30 BST?

sbalikondwar (Tue, 23 Jun 2020 14:17:18 GMT):
alright sounds good

seanyoung (Tue, 23 Jun 2020 14:19:28 GMT):
great

sbalikondwar (Tue, 23 Jun 2020 14:54:01 GMT):
looks like the tests use mocha for test writting

sbalikondwar (Tue, 23 Jun 2020 15:47:06 GMT):
going for dinner will work on the points, see you

seanyoung (Tue, 23 Jun 2020 16:04:55 GMT):
See you tomorrow

sbalikondwar (Wed, 24 Jun 2020 08:35:59 GMT):
good afternoon

seanyoung (Wed, 24 Jun 2020 10:46:15 GMT):
good afternoon

sbalikondwar (Wed, 24 Jun 2020 11:31:00 GMT):
have you joined?

seanyoung (Wed, 24 Jun 2020 11:31:04 GMT):
sorry my microphone is playing up

seanyoung (Wed, 24 Jun 2020 11:31:09 GMT):
I can hear you, sorry

sbalikondwar (Wed, 24 Jun 2020 11:31:30 GMT):
can you fix it?

sbalikondwar (Thu, 25 Jun 2020 12:41:21 GMT):
good afternoon

seanyoung (Thu, 25 Jun 2020 12:50:22 GMT):
good afternoon

sbalikondwar (Thu, 25 Jun 2020 12:51:36 GMT):
will check today about the repo

sbalikondwar (Thu, 25 Jun 2020 12:51:57 GMT):
forked it, will update it when i complete the remaining part

sbalikondwar (Thu, 25 Jun 2020 12:52:06 GMT):
perhaps a good readme page as well.

seanyoung (Thu, 25 Jun 2020 12:52:16 GMT):
That would be great, thanks

seanyoung (Thu, 25 Jun 2020 12:52:41 GMT):
You can't push to master, you have to create merge requests to master

sbalikondwar (Thu, 25 Jun 2020 12:53:05 GMT):
Yeah will keep that in mind

sbalikondwar (Fri, 26 Jun 2020 14:23:19 GMT):
hi there @seanyoung

seanyoung (Fri, 26 Jun 2020 14:23:30 GMT):
Hello

seanyoung (Fri, 26 Jun 2020 14:23:41 GMT):
How are things

sbalikondwar (Fri, 26 Jun 2020 14:23:44 GMT):
was busy today with some work, will work in weekends

sbalikondwar (Fri, 26 Jun 2020 14:23:56 GMT):
also today as well

seanyoung (Fri, 26 Jun 2020 14:26:59 GMT):
ok, sure

sbalikondwar (Sat, 27 Jun 2020 20:14:00 GMT):
hi there

sbalikondwar (Sat, 27 Jun 2020 20:15:19 GMT):
I did some work today wrote helper functions for tests and one command for checking applyEdit feature next would be use of the helper funcs to test

sbalikondwar (Sat, 27 Jun 2020 20:17:15 GMT):
see you tomorrow

seanyoung (Sun, 28 Jun 2020 12:41:27 GMT):
Hi there

seanyoung (Sun, 28 Jun 2020 12:41:50 GMT):
Sounds good, look forward to seeing your changes. How are you?

sbalikondwar (Sun, 28 Jun 2020 16:14:32 GMT):
good, things are also good here

sbalikondwar (Sun, 28 Jun 2020 16:14:40 GMT):
kind of over slept

sbalikondwar (Sun, 28 Jun 2020 16:14:40 GMT):
kind of over slept today

sbalikondwar (Sun, 28 Jun 2020 16:15:35 GMT):
for the tests it is also going good, I have some minor issue in the implementation so it is failing but i am sure I can fix it

sbalikondwar (Sun, 28 Jun 2020 16:16:02 GMT):
I can push now but it is not complete anyways will push it just as backup

sbalikondwar (Sun, 28 Jun 2020 16:17:12 GMT):
worked today in the afternoon and evening going for my dinner and will look at when I return

sbalikondwar (Sun, 28 Jun 2020 16:17:22 GMT):
what about you, how are you?

seanyoung (Sun, 28 Jun 2020 18:09:51 GMT):
I'm ok. I'm getting close to merging the changes needed for solang.

sbalikondwar (Mon, 29 Jun 2020 09:29:43 GMT):
good afternoon

sbalikondwar (Mon, 29 Jun 2020 09:30:39 GMT):
pushed some changes on the hyperledger labs fork

sbalikondwar (Mon, 29 Jun 2020 09:31:09 GMT):
solving issues with the tests but just posted to keep update on the work

seanyoung (Mon, 29 Jun 2020 10:10:55 GMT):
good afternoon

seanyoung (Mon, 29 Jun 2020 10:19:06 GMT):
strange, I'm getting errors on https://github.com/Hyperion101010/sls/pulls

seanyoung (Mon, 29 Jun 2020 10:19:12 GMT):
I'm sure it will resolve itself

seanyoung (Mon, 29 Jun 2020 10:22:00 GMT):
ah it's working again, strange

seanyoung (Mon, 29 Jun 2020 10:25:47 GMT):
ah I should be looking here anyway https://github.com/hyperledger-labs/solang-vscode/pull/2/files

seanyoung (Mon, 29 Jun 2020 10:25:58 GMT):
let's have a review when you're ready

sbalikondwar (Mon, 29 Jun 2020 11:01:39 GMT):
Sure

sbalikondwar (Mon, 29 Jun 2020 11:01:48 GMT):
Well I uploaded on Hyperledger labs

sbalikondwar (Mon, 29 Jun 2020 11:02:09 GMT):
GitHub was down one hour ago

sbalikondwar (Mon, 29 Jun 2020 11:02:22 GMT):
So that should be the anamoly

seanyoung (Mon, 29 Jun 2020 11:47:11 GMT):
That would explain it

sbalikondwar (Mon, 29 Jun 2020 21:04:21 GMT):
did some work issue is of server launch in tests

sbalikondwar (Mon, 29 Jun 2020 21:04:21 GMT):
did some work, issue is of server launch in tests

sbalikondwar (Mon, 29 Jun 2020 21:04:31 GMT):
will continue tommorow

sbalikondwar (Mon, 29 Jun 2020 21:04:44 GMT):
logging off, see you @seanyoung

sbalikondwar (Tue, 30 Jun 2020 12:26:25 GMT):
So i have this issue in which I will open one issue on the vscode editor repo, also i added some info on the readme @seanyoung check here https://github.com/Hyperion101010/sls/tree/p1_work

sbalikondwar (Tue, 30 Jun 2020 12:27:21 GMT):
good afternoon

sbalikondwar (Tue, 30 Jun 2020 12:30:50 GMT):
The issue I am facing now is when I try to run the tests the extension is initialised properly but as it appears the server has to be initialised differently while tests

sbalikondwar (Tue, 30 Jun 2020 12:32:33 GMT):
when you become free can you a look at the above repo ? that would be very helpful plus i will see if an issue req on the vscode repo can help it

seanyoung (Tue, 30 Jun 2020 13:43:12 GMT):
good afternoon

seanyoung (Tue, 30 Jun 2020 13:43:24 GMT):
I'll have a look

seanyoung (Tue, 30 Jun 2020 14:27:23 GMT):
Interesting, it looks like the server won't start and the error message is nowhere to be found.

sbalikondwar (Tue, 30 Jun 2020 14:35:20 GMT):
You are running the tests right?

seanyoung (Tue, 30 Jun 2020 14:35:28 GMT):
yes

sbalikondwar (Tue, 30 Jun 2020 14:36:01 GMT):
One min I'll put my observation

seanyoung (Tue, 30 Jun 2020 14:36:21 GMT):
That would be great, thanks. I'm trying to debug it right now.

sbalikondwar (Tue, 30 Jun 2020 14:38:30 GMT):

Screenshot from 2020-06-30 20-08-07.png

sbalikondwar (Tue, 30 Jun 2020 14:38:56 GMT):
the logic is present in helper and extension file in test dir

sbalikondwar (Tue, 30 Jun 2020 14:40:04 GMT):
If i try to launch the client as i do normally (non test run) then there is no such promise issue, infact it is not compulsory to issue promise for extensions

seanyoung (Tue, 30 Jun 2020 14:42:29 GMT):
Right, ok. I'll try and debug it.

sbalikondwar (Tue, 30 Jun 2020 14:42:42 GMT):
thanks i am also trying on my side

seanyoung (Tue, 30 Jun 2020 15:30:11 GMT):
Shall we meet tomorrow again at 5pm IST?

sbalikondwar (Tue, 30 Jun 2020 15:31:43 GMT):
Sure

seanyoung (Tue, 30 Jun 2020 15:31:51 GMT):
great

seanyoung (Tue, 30 Jun 2020 15:34:57 GMT):
If I try to launch the client as normal (just press F5) it does not work. Same error as in the test.

sbalikondwar (Tue, 30 Jun 2020 15:38:29 GMT):
No it works with f5

sbalikondwar (Tue, 30 Jun 2020 15:38:37 GMT):
And not in test

sbalikondwar (Tue, 30 Jun 2020 15:38:57 GMT):
The option is Launch Client

sbalikondwar (Tue, 30 Jun 2020 15:40:29 GMT):
Wait one min should be some changes

sbalikondwar (Tue, 30 Jun 2020 15:40:37 GMT):
I will fix them asap

seanyoung (Tue, 30 Jun 2020 15:41:15 GMT):
Well it does not work for me. You're registering slang-ex.applyedit. I'm not sure it should be registered though.

sbalikondwar (Tue, 30 Jun 2020 15:41:43 GMT):
Sorry will update it and then let you know

seanyoung (Tue, 30 Jun 2020 15:48:46 GMT):
I haven't gotten the test to work yet. It's pretty confusing :/

seanyoung (Tue, 30 Jun 2020 15:49:00 GMT):
(I mean vscode node modules are confusing)

sbalikondwar (Tue, 30 Jun 2020 15:57:20 GMT):
Yeah they are confusing I am so sorry for the delay I just tested once and it was working after sometime when I did some minor edits and I pushed it went unchecked

sbalikondwar (Tue, 30 Jun 2020 15:57:44 GMT):
Got to go for dinner will update it

seanyoung (Tue, 30 Jun 2020 15:58:17 GMT):
ok don't worry, these things happen. Enjoy your dinner

sbalikondwar (Tue, 30 Jun 2020 19:42:54 GMT):
ok pushed it, please check when you get free

seanyoung (Tue, 30 Jun 2020 19:43:07 GMT):
great, thanks!

sbalikondwar (Tue, 30 Jun 2020 19:43:32 GMT):
Looks like using --amend in commits can do conflicts so had to do hard reset and change files manually

seanyoung (Tue, 30 Jun 2020 19:45:15 GMT):
if you amend a commit that already been pushed to github, you have to push it with `--force`

sbalikondwar (Tue, 30 Jun 2020 19:45:49 GMT):
got it the last one was not forced :sweat_smile:

sbalikondwar (Tue, 30 Jun 2020 19:45:49 GMT):
got it, the last one was not forced :sweat_smile:

seanyoung (Tue, 30 Jun 2020 19:50:40 GMT):
does `npm test` work now?

seanyoung (Tue, 30 Jun 2020 19:51:34 GMT):
Running it with F5 works now, that's great

sbalikondwar (Tue, 30 Jun 2020 19:51:38 GMT):
the test shouldn't be used like that but through Extension test option from F5

sbalikondwar (Tue, 30 Jun 2020 19:52:30 GMT):
so you can see there is some issue with test, while the extension standalone works fine

sbalikondwar (Tue, 30 Jun 2020 19:52:46 GMT):
One less thing to worry about!

seanyoung (Tue, 30 Jun 2020 19:52:53 GMT):
Yes, looks good!

sbalikondwar (Tue, 30 Jun 2020 19:53:23 GMT):
Today went in debugging and fixing things

sbalikondwar (Tue, 30 Jun 2020 19:54:19 GMT):
Its dark here will join in early tomorrow and the first thing will be to log some issues on vscode repo and relevant platform for solving my test issue

seanyoung (Tue, 30 Jun 2020 19:54:39 GMT):
Yes, it's pretty late!

sbalikondwar (Tue, 30 Jun 2020 19:54:50 GMT):
as last time external help was valuable

sbalikondwar (Tue, 30 Jun 2020 19:54:56 GMT):
see you then @seanyoung

seanyoung (Tue, 30 Jun 2020 19:55:04 GMT):
good progress, see tomorrow

seanyoung (Tue, 30 Jun 2020 19:55:04 GMT):
good progress, see you tomorrow

sbalikondwar (Wed, 01 Jul 2020 11:19:17 GMT):
good afternoon

sbalikondwar (Wed, 01 Jul 2020 11:19:22 GMT):
logged an issue https://github.com/microsoft/vscode-test/issues/65

sbalikondwar (Wed, 01 Jul 2020 11:19:31 GMT):
lets see

seanyoung (Wed, 01 Jul 2020 11:20:22 GMT):
good afternoon

seanyoung (Wed, 01 Jul 2020 11:20:28 GMT):
We can't wait for an answer, we should try to debug ourselves as well in case there is no answer.

seanyoung (Wed, 01 Jul 2020 11:20:46 GMT):
When I was debugging it, the server did start as far as I can see

seanyoung (Wed, 01 Jul 2020 11:20:59 GMT):
Do you know how to increase the timeout in the test?

seanyoung (Wed, 01 Jul 2020 11:21:13 GMT):
I would like to see what's going on but it's too fast.

sbalikondwar (Wed, 01 Jul 2020 11:22:28 GMT):
yeah thats a good insight

sbalikondwar (Wed, 01 Jul 2020 11:23:01 GMT):
just logged as a background task(but not dependent on their help)

sbalikondwar (Wed, 01 Jul 2020 11:24:07 GMT):
about timeout i think this can be the reason of the issue but i changed it here https://github.com/Hyperion101010/sls/blob/master/src/test/suite/helper.ts#L31

sbalikondwar (Wed, 01 Jul 2020 11:24:07 GMT):
about timeout i think this can be the reason of the issue but i changed the timeout here https://github.com/Hyperion101010/sls/blob/master/src/test/suite/helper.ts#L31

seanyoung (Wed, 01 Jul 2020 11:24:48 GMT):
That's delaying the server activation. I would like to see a sleep in the test itself.

sbalikondwar (Wed, 01 Jul 2020 11:24:59 GMT):
Still it shows timeout for 2000 ms in logs while we are using 10000ms so that is suspicious

sbalikondwar (Wed, 01 Jul 2020 11:25:14 GMT):
ok will try that

seanyoung (Wed, 01 Jul 2020 11:53:56 GMT):
Looks like increasing the timeout was all that was needed.

seanyoung (Wed, 01 Jul 2020 11:53:58 GMT):
https://github.com/Hyperion101010/sls/pull/3

seanyoung (Wed, 01 Jul 2020 11:54:36 GMT):
That sleep in `activate()` shouldn't be there.

sbalikondwar (Wed, 01 Jul 2020 11:57:14 GMT):
Ok looking

seanyoung (Wed, 01 Jul 2020 12:02:17 GMT):
I was looking at https://stackoverflow.com/questions/23492043/change-default-timeout-for-mocha#23492442 and tried this.

seanyoung (Wed, 01 Jul 2020 12:02:25 GMT):
Does vscode-test use mocha?

sbalikondwar (Wed, 01 Jul 2020 12:02:36 GMT):
Yes

sbalikondwar (Wed, 01 Jul 2020 12:43:16 GMT):
ok so it was indeed a timeout issue fixed it thanks @seanyoung

sbalikondwar (Wed, 01 Jul 2020 12:43:49 GMT):

Screenshot from 2020-07-01 18-12-45.png

seanyoung (Wed, 01 Jul 2020 12:51:02 GMT):
Great!

seanyoung (Wed, 01 Jul 2020 12:51:27 GMT):
This shows how to create the github action which runs build and test on github pull requests

seanyoung (Wed, 01 Jul 2020 12:51:29 GMT):
https://help.github.com/en/actions/language-and-framework-guides/using-nodejs-with-github-actions

sbalikondwar (Wed, 01 Jul 2020 12:53:42 GMT):
looking into this

sbalikondwar (Wed, 01 Jul 2020 12:57:08 GMT):
:coffee: time

seanyoung (Wed, 01 Jul 2020 13:00:58 GMT):
enjoy

seanyoung (Wed, 01 Jul 2020 13:03:58 GMT):
https://github.com/microsoft/vscode-test/issues/65 probably needs closing

sbalikondwar (Wed, 01 Jul 2020 13:06:53 GMT):
done

sbalikondwar (Wed, 01 Jul 2020 18:56:21 GMT):
back

sbalikondwar (Wed, 01 Jul 2020 19:01:09 GMT):
updated master for docs and the test https://github.com/Hyperion101010/sls

sbalikondwar (Wed, 01 Jul 2020 19:01:19 GMT):
you can checkout in the readme

sbalikondwar (Wed, 01 Jul 2020 19:01:37 GMT):
about the push code checks on build bots will do it tomorrow

sbalikondwar (Wed, 01 Jul 2020 19:02:25 GMT):
today I had a festival where we fast all day and do some rituals so got busy in the evening.

sbalikondwar (Wed, 01 Jul 2020 19:03:28 GMT):
can also work on adding some interesting things.

sbalikondwar (Wed, 01 Jul 2020 19:39:03 GMT):
see you tomorrow

seanyoung (Thu, 02 Jul 2020 09:11:24 GMT):
just out of interest, what festival did you have?

sbalikondwar (Thu, 02 Jul 2020 10:46:56 GMT):
good afternoon

seanyoung (Thu, 02 Jul 2020 10:48:41 GMT):
good afternoon

sbalikondwar (Thu, 02 Jul 2020 10:49:16 GMT):
kind of astronomical and religious https://en.wikipedia.org/wiki/Shayani_Ekadashi#:~:text=On%20this%20day%20images%20of,fasting%20on%20every%20Ekadashi%20day.

seanyoung (Thu, 02 Jul 2020 10:49:35 GMT):
Let me know if you have any trouble with the github actions. It can be a bit fiddly to get it right. You end up pushing lots of tests to your pr until it works :)

sbalikondwar (Thu, 02 Jul 2020 10:50:25 GMT):
yeah sure :grin:

seanyoung (Thu, 02 Jul 2020 11:03:29 GMT):
That's very interesting, I had not heard of that.

sbalikondwar (Fri, 03 Jul 2020 21:01:17 GMT):
Hi there, was away today will join in tomorrow for working in weekends :slight_smile:

seanyoung (Sat, 04 Jul 2020 10:29:29 GMT):
Hi, sure

seanyoung (Sun, 05 Jul 2020 15:18:46 GMT):
@sbalikondwar just noticed you merged https://github.com/Hyperion101010/sls/blob/master/.github/workflows/ci.yaml You need to add pull_request to the list of actions to make it work on pull requests. It should work for the pull request straight away without merging.

seanyoung (Sun, 05 Jul 2020 15:19:13 GMT):
like so: https://github.com/hyperledger-labs/solang/blob/master/.github/workflows/test.yml#L2

sbalikondwar (Sun, 05 Jul 2020 15:30:21 GMT):
good evening

seanyoung (Sun, 05 Jul 2020 15:30:33 GMT):
good evening

sbalikondwar (Sun, 05 Jul 2020 15:31:18 GMT):
yes i was not knowing about the fact that it works without merge, taking a look at it

sbalikondwar (Sun, 05 Jul 2020 15:32:32 GMT):
i should read this first https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions

seanyoung (Sun, 05 Jul 2020 15:46:25 GMT):
If you have any questions, I can try to help.

sbalikondwar (Sun, 05 Jul 2020 15:47:07 GMT):
I will try and solve them today, will ask till tomorrow if something goes wrong

sbalikondwar (Sun, 05 Jul 2020 20:05:03 GMT):
Woohoo! push actions working perfectly @seanyoung

sbalikondwar (Sun, 05 Jul 2020 20:05:24 GMT):

Screenshot from 2020-07-06 01-32-27.png

sbalikondwar (Sun, 05 Jul 2020 20:06:57 GMT):
So for now as planned we have completed basic test + doc + ci + server + extension + syntax highlight + bracket completion + hover on basic level

sbalikondwar (Sun, 05 Jul 2020 20:07:31 GMT):
glad that we have extra time for our next and the interesting part!

sbalikondwar (Sun, 05 Jul 2020 20:08:19 GMT):
also eval is near

sbalikondwar (Sun, 05 Jul 2020 20:08:42 GMT):
will quickly merge in master and then open a PR for hyperledger labs

sbalikondwar (Sun, 05 Jul 2020 21:30:01 GMT):
ok so i added ci for extension and it is working correctly

sbalikondwar (Sun, 05 Jul 2020 21:30:36 GMT):
there is a slight problem with rust ci

seanyoung (Sun, 05 Jul 2020 21:30:54 GMT):
That's great

sbalikondwar (Sun, 05 Jul 2020 21:30:59 GMT):
but as we are going to work on the rust impl from now on

sbalikondwar (Sun, 05 Jul 2020 21:31:14 GMT):
i thought to add rust side ci later

sbalikondwar (Sun, 05 Jul 2020 21:31:39 GMT):
i mean while we are working on compilation cause we will then be working with only rust side

seanyoung (Sun, 05 Jul 2020 21:31:45 GMT):
Cargo/rustc might not be available. Some steps must be done to install them.

sbalikondwar (Sun, 05 Jul 2020 21:32:17 GMT):
its complicated there are submodules

sbalikondwar (Sun, 05 Jul 2020 21:33:20 GMT):
the thing is the extension test will only work if rust server is working, so if we have the extension tests which are passing then surely the rust server is working

sbalikondwar (Sun, 05 Jul 2020 21:34:05 GMT):
atleast for now will it be possible to hold on the rust side checks and handle it when we are working on compilation which is anyways from tomorrow?

sbalikondwar (Sun, 05 Jul 2020 21:34:27 GMT):
I will dicuss the hurdles tomorrow

sbalikondwar (Sun, 05 Jul 2020 21:35:02 GMT):
quite late today, see you

seanyoung (Sun, 05 Jul 2020 22:10:04 GMT):
See you

sbalikondwar (Mon, 06 Jul 2020 08:14:46 GMT):
good afternoon

seanyoung (Mon, 06 Jul 2020 08:18:23 GMT):
good afternoon

sbalikondwar (Mon, 06 Jul 2020 08:19:40 GMT):
Ok so here is the update: Tests for extension are running and passing, can we shift the meet to today @seanyoung if you are free?

seanyoung (Mon, 06 Jul 2020 08:20:13 GMT):
Sure, today is fine. What time suits?

seanyoung (Mon, 06 Jul 2020 08:20:25 GMT):
Same time as usual?

sbalikondwar (Mon, 06 Jul 2020 08:20:29 GMT):
I am free from now

sbalikondwar (Mon, 06 Jul 2020 08:22:10 GMT):
let me know about the hours

seanyoung (Mon, 06 Jul 2020 08:22:11 GMT):
Right I have just woken up, let me have my breakfast. How about in half an hour?

sbalikondwar (Mon, 06 Jul 2020 08:22:32 GMT):
sure when you are free, let's do one hour?

sbalikondwar (Mon, 06 Jul 2020 08:22:32 GMT):
sure when you are free, let's do after one hour?

sbalikondwar (Mon, 06 Jul 2020 08:22:36 GMT):
after

sbalikondwar (Mon, 06 Jul 2020 08:24:12 GMT):
just ping me when you are available

seanyoung (Mon, 06 Jul 2020 08:29:46 GMT):
sure, thanks

seanyoung (Mon, 06 Jul 2020 08:53:49 GMT):
Hi, thanks for waiting. I'm ready whenever you are

sbalikondwar (Mon, 06 Jul 2020 08:55:44 GMT):
Coming in 10 min

sbalikondwar (Mon, 06 Jul 2020 09:03:45 GMT):
ok let's join in

sbalikondwar (Mon, 06 Jul 2020 09:09:30 GMT):
https://github.com/Hyperion101010/sls/blob/rust-actions/.github/workflows/rust.yaml

sbalikondwar (Mon, 06 Jul 2020 09:09:52 GMT):
https://github.com/Hyperion101010/sls/tree/rust-actions

seanyoung (Mon, 06 Jul 2020 09:12:13 GMT):
https://github.com/hyperledger-labs/solang/blob/master/.github/workflows/test.yml#L46

seanyoung (Mon, 06 Jul 2020 09:12:56 GMT):
https://github.com/Hyperion101010/sls/runs/839394235?check_suite_focus=true

seanyoung (Mon, 06 Jul 2020 09:17:29 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/lib.rs#L104

seanyoung (Mon, 06 Jul 2020 09:21:03 GMT):
``` [dependencies] solang = { git = "https://github.com/hyperledger-labs/solang" } ```

seanyoung (Mon, 06 Jul 2020 09:26:37 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs

seanyoung (Mon, 06 Jul 2020 09:27:08 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L619

seanyoung (Mon, 06 Jul 2020 09:29:56 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L664

seanyoung (Mon, 06 Jul 2020 09:30:50 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/symtable.rs#L20

sbalikondwar (Mon, 06 Jul 2020 12:11:32 GMT):
tried pushing changes but it needs to be signed

sbalikondwar (Mon, 06 Jul 2020 12:11:32 GMT):
tried pushing changes but it needs to be signed off

sbalikondwar (Mon, 06 Jul 2020 12:12:50 GMT):
some are verified and some not https://github.com/hyperledger-labs/solang-vscode/pull/3/commits

sbalikondwar (Mon, 06 Jul 2020 12:12:58 GMT):
not sure how to deal with it

sbalikondwar (Mon, 06 Jul 2020 12:17:27 GMT):
is it necessary to sign off commits? its first time i experienced such thing

seanyoung (Mon, 06 Jul 2020 13:11:32 GMT):
Yes, all commits must be signed off by a real person. This is called DCO. https://wiki.hyperledger.org/display/BESU/DCO https://wiki.hyperledger.org/display/TSC/DCO+and+Pseudonyms

seanyoung (Mon, 06 Jul 2020 13:11:55 GMT):
So, to fix this you can use `git rebase -i '

seanyoung (Mon, 06 Jul 2020 13:11:55 GMT):
So, to fix this you can use `git rebase -i `

seanyoung (Mon, 06 Jul 2020 13:13:08 GMT):
You will get a text editor with a file listing commits. Chance `pick` to `reword` on every line, and save the file and exit the editor. The text editor will pop up for every commit message allowing you to add a `Signed-off-by: ...` line.

seanyoung (Mon, 06 Jul 2020 13:14:26 GMT):
Last thing to note that is I'm keen on keeping the git history clean and merging all these commits into one commit. To do that, change `pick` to `squash` on every line *except* the first. Now you have a single commit.

seanyoung (Mon, 06 Jul 2020 13:15:06 GMT):
After changing git history with `git rebase`, you must push with `git push -f`.

seanyoung (Mon, 06 Jul 2020 13:15:23 GMT):
Lastly note that git rebase is dangerous so make sure you have a backup of your work.

sbalikondwar (Mon, 06 Jul 2020 13:24:37 GMT):
i can squash and then sign off ? that way I will have to only signoff one commit

seanyoung (Mon, 06 Jul 2020 13:24:54 GMT):
Yes, I think that is ideal.

sbalikondwar (Mon, 06 Jul 2020 15:17:29 GMT):
ok so there is a slight problem

sbalikondwar (Mon, 06 Jul 2020 15:18:21 GMT):
the first commit I did on june 8 is left to be signed and i am surprised this one is not happening through the above method

sbalikondwar (Mon, 06 Jul 2020 15:19:33 GMT):
yeah just a minute i forgot about the reowrd thing

sbalikondwar (Mon, 06 Jul 2020 15:19:33 GMT):
yeah just a minute i forgot about the reword thing, checking that thing

seanyoung (Mon, 06 Jul 2020 16:10:17 GMT):
another way of doing this is create a new branch based of master, like `git checkout -b foo origin/master` and then either copy the files in and commit, or use `git cherry-pick` to get them from another branch.

seanyoung (Mon, 06 Jul 2020 16:10:32 GMT):
How are you getting on? Anything I can help with?

sbalikondwar (Mon, 06 Jul 2020 17:34:18 GMT):
yeah so there are some complications in it

sbalikondwar (Mon, 06 Jul 2020 17:48:28 GMT):
so the thing is, the git rebase works from one lowest pick to the most recent pick

sbalikondwar (Mon, 06 Jul 2020 17:48:46 GMT):
In my case i am left with one old commit which is not signed

sbalikondwar (Mon, 06 Jul 2020 17:54:37 GMT):
hyperion@hyperion-rog:~/intern/hyperledger/sls/practice/slang-ex$ git log commit 908e683aabb587fb8113f2bd749bcd8329748c7c (HEAD -> lb2) Author: Shivam Balikondwar Date: Tue Jun 9 21:21:05 2020 +0530 parent d2f53c90d780a578bea6dcdede4cd3da26154805 author Shivam Balikondwar 1591717865 +0530 committer Shivam Balikondwar 1594057775 +0530 Follow up on client side request. Done Signed-off-by: Shivam Balikondwar Fix the server and client attach problem. Some connection error. Make server attach work Signed-off-by: Sean Young WIP: Communicate with rust lsp Tried some methods but failed. Working on same. [WIP]: Message request and response working. Follow up. Fix up on the build/operation failure. Need some help on tests. Increase timeout to make test work Signed-off-by: Sean Young Tests working fine now. Done. Added some doc for readme. Done. Add ci actions to the repo. WIP, pushed for sample testing. Initial commit Signed-off-by: Ry Jones commit d2f53c90d780a578bea6dcdede4cd3da26154805 Author: Shivam Balikondwar Date: Mon Jun 8 02:37:38 2020 +0530 WIP: Client side extension request. Added two commands. Working on adding stdio message passing.

sbalikondwar (Mon, 06 Jul 2020 17:55:35 GMT):
so as you can see the second commit is not squashed cause the rebase can only squash from end-1 to latest commit to a new commit and not the end commit

sbalikondwar (Mon, 06 Jul 2020 18:01:38 GMT):
ok now as a last option I will just copy the files and create a clean commit and from next on will remember to always signoff the doc

sbalikondwar (Mon, 06 Jul 2020 18:16:40 GMT):
ok fixed the changes, was a different command than known

sbalikondwar (Mon, 06 Jul 2020 18:17:19 GMT):
had to use git rebase -i root

sbalikondwar (Mon, 06 Jul 2020 18:20:59 GMT):
phew what a relief

sbalikondwar (Mon, 06 Jul 2020 18:21:10 GMT):
https://github.com/hyperledger-labs/solang-vscode/pull/6 @seanyoung good for review

sbalikondwar (Mon, 06 Jul 2020 18:21:44 GMT):
i better delete that junk message

seanyoung (Mon, 06 Jul 2020 18:34:02 GMT):
Yes, that message should really be cleaned up. For one thing Ry Jones shouldn't be in the signed-off-by

seanyoung (Mon, 06 Jul 2020 18:34:21 GMT):
However I can start with the review

sbalikondwar (Mon, 06 Jul 2020 18:35:18 GMT):
Ah the thing is the message had Ry Jones in the log so it just got attached

sbalikondwar (Mon, 06 Jul 2020 18:35:37 GMT):
Infact I had to pull and merge to push the changes

sbalikondwar (Mon, 06 Jul 2020 18:36:39 GMT):
@seanyoung will work in parallel on the review and on other side on the next phase

sbalikondwar (Mon, 06 Jul 2020 18:36:54 GMT):
For today will take my leave, it's quite dark here

sbalikondwar (Mon, 06 Jul 2020 18:37:24 GMT):
see you tomorrow, night

seanyoung (Mon, 06 Jul 2020 18:39:53 GMT):
see you tomorrow

seanyoung (Tue, 07 Jul 2020 08:41:17 GMT):
Good day @sbalikondwar If you open a pull request on a github repo, then if it's incorrect you don't need to close it and open a new one. You can (force) push to the same branch and the pull request will update automatically.

seanyoung (Tue, 07 Jul 2020 08:55:54 GMT):
Using `git rebase` from the initial commit does seem to work well, I've seen that before. Sorry about suggesting `git rebase`. There is a different strategy: ``` git clone git@github.com:/Hyperion101010/solang-vscode git checkout -b lb4 origin/master git merge --squash origin/lb3 git commit -s -m "Merge first version" git push -f origin lb4:lb3 ```

seanyoung (Tue, 07 Jul 2020 08:57:14 GMT):
So this does a new clone, creates a new branch lb4 and squash merges the lb3. Then it commits this with a signed-off-by, and pushes it over the existing lb3 branch so the existing pull request gets updated. Hope this makes sense.

seanyoung (Tue, 07 Jul 2020 09:28:50 GMT):
I've also left a review. Please let me know if it makes sense.

sbalikondwar (Tue, 07 Jul 2020 11:12:32 GMT):
about the rust yaml i told you that it won't be useful to add actions for rust atleast for now cause the tower-lsp will have to be restructed

sbalikondwar (Tue, 07 Jul 2020 11:12:32 GMT):
about the rust yaml i told you that it won't be useful to add actions for rust atleast for now cause the tower-lsp will have to be restructed in subsequent steps, moreover the extension test run rust server anyhow so we confirm the server is running

sbalikondwar (Tue, 07 Jul 2020 11:12:32 GMT):
about the rust yaml i told you that it won't be useful to add actions for rust atleast for now cause the tower-lsp will have to be restructed in subsequent milestones, moreover the extension test run rust server anyhow so we confirm the server is running

sbalikondwar (Tue, 07 Jul 2020 11:14:09 GMT):
good afternoon

seanyoung (Tue, 07 Jul 2020 11:17:06 GMT):
ok, as long as the test verifies it is running

sbalikondwar (Wed, 08 Jul 2020 07:34:51 GMT):
you commented about the fact that the timeout should be something better than random number

sbalikondwar (Wed, 08 Jul 2020 07:35:31 GMT):
I am not sure how to logically determine this

sbalikondwar (Wed, 08 Jul 2020 07:36:00 GMT):
from what i have observed 20 s is the favourable time

sbalikondwar (Wed, 08 Jul 2020 07:36:45 GMT):
and usually 2000 ms is given everywhere in the vscode sample codes on their repo

sbalikondwar (Wed, 08 Jul 2020 07:37:50 GMT):
https://github.com/microsoft/vscode-extension-samples/blob/master/lsp-sample/client/src/test/helper.ts#L24

sbalikondwar (Wed, 08 Jul 2020 07:38:21 GMT):
for the issue: https://github.com/hyperledger-labs/solang-vscode/pull/6/files/7ad4c208071b92981581468e251a48c12b5c5462#r450729062

seanyoung (Wed, 08 Jul 2020 07:48:27 GMT):
interesting that the vscode example even has this example sleep

sbalikondwar (Wed, 08 Jul 2020 07:51:35 GMT):
Yes it was a tough find

seanyoung (Wed, 08 Jul 2020 07:56:47 GMT):
is the sleep for the tower-lsp to start?

sbalikondwar (Wed, 08 Jul 2020 08:02:06 GMT):
Partly cause we already have a delay implemented of 20s outside the activate function call, this 2s delay should be considered for the time in launching threads and opening files

seanyoung (Wed, 08 Jul 2020 08:07:13 GMT):
There is a difference between a timeout and a sleep.

seanyoung (Wed, 08 Jul 2020 08:07:33 GMT):
Code shouldn't have a sleep in it to make it work.

sbalikondwar (Wed, 08 Jul 2020 08:12:30 GMT):
Ok so should I remove it?

seanyoung (Wed, 08 Jul 2020 08:16:40 GMT):
It should be removed

seanyoung (Wed, 08 Jul 2020 08:17:03 GMT):
the test still works without the sleep for me

seanyoung (Wed, 08 Jul 2020 08:17:42 GMT):
if there is an aync operation happening somewhere then we should wait for that

seanyoung (Wed, 08 Jul 2020 08:18:08 GMT):
Not something to delay eval 1 for, if it doesn't work

sbalikondwar (Wed, 08 Jul 2020 08:23:19 GMT):
Ok u tried a while ago by removing it Will look into it

sbalikondwar (Wed, 08 Jul 2020 08:23:19 GMT):
Ok i tried a while ago by removing it Will look into it

sbalikondwar (Wed, 08 Jul 2020 08:23:48 GMT):
Was running at that time

seanyoung (Wed, 08 Jul 2020 08:33:27 GMT):
There is one test for applying some edit, but not for sending message to tower-lsp.

sbalikondwar (Wed, 08 Jul 2020 08:47:13 GMT):
I thought about that, so in the server exchanges messages through LSP which can be implemented through the vscode extension commands like hover provider, applying edits, saving/opening files

sbalikondwar (Wed, 08 Jul 2020 08:47:13 GMT):
I thought about that, so the server exchanges messages through LSP which can be implemented through the vscode extension commands like hover provider, applying edits, saving/opening files

sbalikondwar (Wed, 08 Jul 2020 08:48:25 GMT):
I didn't find any tests for hover provider but there was one for apply edits

sbalikondwar (Wed, 08 Jul 2020 08:49:57 GMT):
for now we have sample hover provider, apply edit and a notification since we only wanted to confirm the exchange of messages

sbalikondwar (Wed, 08 Jul 2020 09:41:29 GMT):
I can't comment the license and copyright inside json, and there is already a license file from ryjones repo

sbalikondwar (Wed, 08 Jul 2020 09:41:55 GMT):
i need to make a different file to keep record of the copyright and commit hash etc

sbalikondwar (Wed, 08 Jul 2020 09:42:07 GMT):
will that be ok @seanyoung

seanyoung (Wed, 08 Jul 2020 09:43:15 GMT):
That's fine. You could also have a separate commit with just these files explaining where they come from/license etc.

seanyoung (Wed, 08 Jul 2020 09:43:37 GMT):
The MIT license explicitly says the copyright statements need to be carried

sbalikondwar (Wed, 08 Jul 2020 09:46:02 GMT):
ok so what should i name the additional license file ?

seanyoung (Wed, 08 Jul 2020 09:46:38 GMT):
How about LICENSE and keep it in the same directory?

sbalikondwar (Wed, 08 Jul 2020 09:51:02 GMT):
sure

sbalikondwar (Wed, 08 Jul 2020 09:51:28 GMT):
but both are named license :sweat_smile: !

sbalikondwar (Wed, 08 Jul 2020 09:52:51 GMT):
or there can be two files license and one dir for external licenses/deps

sbalikondwar (Wed, 08 Jul 2020 09:52:51 GMT):
or there can be two files license and one dir for external licenses/text deps

sbalikondwar (Wed, 08 Jul 2020 09:52:51 GMT):
or there can be one file license and one dir for external licenses/text deps

seanyoung (Wed, 08 Jul 2020 09:54:21 GMT):
Another way of doing this is in the main README.md

seanyoung (Wed, 08 Jul 2020 09:54:48 GMT):
Just a paragraph with a list of files, license and copyright statements

sbalikondwar (Wed, 08 Jul 2020 09:55:21 GMT):
yeah thats good, so will list out there

sbalikondwar (Wed, 08 Jul 2020 10:00:11 GMT):
something like this https://pastebin.com/XrH49puz

seanyoung (Wed, 08 Jul 2020 10:03:19 GMT):
I'm really nitpicking now but maybe list the full paths for the files (like syntaxes/solidity.json). Looks great otherwise

sbalikondwar (Wed, 08 Jul 2020 10:05:03 GMT):
ok great

sbalikondwar (Wed, 08 Jul 2020 10:12:17 GMT):
going for lunch will be back in a while

seanyoung (Wed, 08 Jul 2020 10:12:40 GMT):
enjoy

sbalikondwar (Wed, 08 Jul 2020 11:48:56 GMT):
back, fixed changes in local

sbalikondwar (Wed, 08 Jul 2020 11:49:39 GMT):
so I was developing things and after a while i broke some code which i created a branch and fixed it

sbalikondwar (Wed, 08 Jul 2020 11:51:05 GMT):
so i think git merge --squash origin/lb3 from my new branch will merge changes

seanyoung (Wed, 08 Jul 2020 11:54:28 GMT):
perfect

sbalikondwar (Wed, 08 Jul 2020 12:08:23 GMT):
ok so alongwith the commit some additonal unsigned logs also got added :frowning2:

sbalikondwar (Wed, 08 Jul 2020 12:09:55 GMT):
for now will have to squash all those commits, anyway i can direct the changes to the current review branch

sbalikondwar (Wed, 08 Jul 2020 12:09:55 GMT):
for now will have to squash all those commits, anyway using which i can direct the changes to the current review branch

seanyoung (Wed, 08 Jul 2020 12:10:08 GMT):
Best to squash them

sbalikondwar (Wed, 08 Jul 2020 12:42:39 GMT):
what to do for this git merge --squash lb3 (nothing to squash)Already up to date.

sbalikondwar (Wed, 08 Jul 2020 12:44:15 GMT):
looks somewhat like git log --oneline d066512 (HEAD -> lb4) Fixes for review. 7ad4c20 (hype_labs/lb3, lb3) Merge branch 'master' of https://github.com/hyperledger-labs/solang-vscode into lb3 9495606 author Shivam Balikondwar 1591564058 +0530 committer Shivam Balikondwar 1594059178 +0530 cfa9bf6 (labs/master, hype_labs/master) Initial commit

seanyoung (Wed, 08 Jul 2020 12:45:10 GMT):
what remote do you have? `git remote -v`

seanyoung (Wed, 08 Jul 2020 12:45:10 GMT):
what remotes do you have? `git remote -v`

sbalikondwar (Wed, 08 Jul 2020 12:46:25 GMT):
hype_labs https://github.com/Hyperion101010/solang-vscode.git (fetch) hype_labs https://github.com/Hyperion101010/solang-vscode.git (push) labs https://github.com/hyperledger-labs/solang-vscode.git (fetch) labs https://github.com/hyperledger-labs/solang-vscode.git (push) origin https://github.com/Hyperion101010/sls (fetch) origin https://github.com/Hyperion101010/sls (push) sean https://github.com/seanyoung/sls (fetch) sean https://github.com/seanyoung/sls (push) upstream https://github.com/Hyperion101010/sls (fetch) upstream https://github.com/Hyperion101010/sls (push)

seanyoung (Wed, 08 Jul 2020 12:48:29 GMT):
So you're on branch `lb4` which already contains all the changes you want; there is nothing to merge into the current branch. ``` git checkout -b lb5 labs/master git merge --squash lb4 ```

seanyoung (Wed, 08 Jul 2020 12:49:16 GMT):
This creates a new branch `lb5` and then squash merges everything from `lb4` onto it. `lb5` starts with github repo commit.

sbalikondwar (Wed, 08 Jul 2020 12:51:03 GMT):
carried out those steps and now i have a single commit git log --oneline cfa9bf6 (HEAD -> lb5, labs/master, hype_labs/master) Initial commit

seanyoung (Wed, 08 Jul 2020 12:52:00 GMT):
What was the output of the second command?

sbalikondwar (Wed, 08 Jul 2020 12:53:12 GMT):
oh i cleared it, it wrote all changes from the lb4 to labs/master branch

seanyoung (Wed, 08 Jul 2020 12:53:59 GMT):
labs/master is a remote

seanyoung (Wed, 08 Jul 2020 12:53:59 GMT):
labs/master is a remote branch

sbalikondwar (Wed, 08 Jul 2020 12:54:11 GMT):
i meant branch lb5

seanyoung (Wed, 08 Jul 2020 12:54:43 GMT):
I'm not following. What do you have now?

sbalikondwar (Wed, 08 Jul 2020 12:55:58 GMT):
https://pastebin.com/BQ4Q0d21

seanyoung (Wed, 08 Jul 2020 12:56:18 GMT):
ah ok

seanyoung (Wed, 08 Jul 2020 12:56:27 GMT):
it's waiting for you to commit it

seanyoung (Wed, 08 Jul 2020 12:56:47 GMT):
`git commit -s -m "Initial version"

seanyoung (Wed, 08 Jul 2020 12:56:47 GMT):
`git commit -s -m "Initial version"`

seanyoung (Wed, 08 Jul 2020 12:57:03 GMT):
(or a better message)

sbalikondwar (Wed, 08 Jul 2020 12:57:41 GMT):
yes now i have two commits

sbalikondwar (Wed, 08 Jul 2020 12:58:22 GMT):
https://pastebin.com/nb8am6aN

seanyoung (Wed, 08 Jul 2020 12:58:54 GMT):
hmm that's not a great message

seanyoung (Wed, 08 Jul 2020 12:59:02 GMT):
Use `git commit --amend` to fix that

sbalikondwar (Wed, 08 Jul 2020 12:59:18 GMT):
yeah so should i keep only one line message?

seanyoung (Wed, 08 Jul 2020 13:01:10 GMT):
Well, it should be an informative message of the work done.

seanyoung (Wed, 08 Jul 2020 13:01:43 GMT):
The existing message doesn't say anything that is useful really

sbalikondwar (Wed, 08 Jul 2020 13:01:50 GMT):
yeah something like Fixes fo review. Fixed copyright, license, comments, etc.

seanyoung (Wed, 08 Jul 2020 13:02:29 GMT):
That doesn't really help anyone.

sbalikondwar (Wed, 08 Jul 2020 13:04:50 GMT):
Fixes for review. Fixed changes for review. Added hover provider, server for LSP, syntax highlighting, test for apply edit. Provided references and license for respective files. Added changes to README for getting started with the extension.

seanyoung (Wed, 08 Jul 2020 13:08:49 GMT):
So this the first import of all our stuff. So someone looking at this in the future won't be helped by "fixes for review". It should be more along the lines of: "First steps of the Solang Solidity Server. Implements hover provider, server for LSP, syntax highlighting, test for apply edit. Uses Solidity grammer from existing Solidity extension (references are the in README). See README for getting started with the extension."

seanyoung (Wed, 08 Jul 2020 13:09:32 GMT):
There actually a whole art to writing a good commit message.

sbalikondwar (Wed, 08 Jul 2020 13:09:42 GMT):
true

seanyoung (Wed, 08 Jul 2020 13:11:01 GMT):
I like this very much https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes

seanyoung (Wed, 08 Jul 2020 13:13:05 GMT):
So the message should be like giving commands to the source code. "Teach foo to do bar" "Foo fails in assertion"

seanyoung (Wed, 08 Jul 2020 13:13:36 GMT):
So a commit message says what the situation was before the commit, what changes you've made, and what should be expected after your commit.

seanyoung (Wed, 08 Jul 2020 13:14:56 GMT):
The problem is when you are debugging something and you find that a particular commit is broken. If that commit just has the message "fixes for review" then you'll be thinking "but why did you change this bit to that".

seanyoung (Wed, 08 Jul 2020 13:15:05 GMT):
Anyway I'll stop rambling.

sbalikondwar (Wed, 08 Jul 2020 13:15:34 GMT):
yeah i understand it should elaborate the significane of the commit

seanyoung (Wed, 08 Jul 2020 13:15:47 GMT):
Yes, exactly.

sbalikondwar (Wed, 08 Jul 2020 13:17:47 GMT):
First steps of the Solang Solidity Server. Implements hover provider, server for LSP, syntax highlighting, test for apply edit. This server is able to execute commands from client, open/close/save files. Uses Solidity grammer from existing Solidity references(references in the README) To get started with the extension follow README.

sbalikondwar (Wed, 08 Jul 2020 13:19:18 GMT):
and the last thing so while uploading how will the current PR track this pushed changes?

sbalikondwar (Wed, 08 Jul 2020 13:19:45 GMT):
i will have to do git push -f hype_labs(my remote fork)

seanyoung (Wed, 08 Jul 2020 13:22:08 GMT):
So your local branch is lb5

seanyoung (Wed, 08 Jul 2020 13:22:28 GMT):
the PR is tracking hype_labs/lb3

seanyoung (Wed, 08 Jul 2020 13:22:45 GMT):
`git push -f hype_labs lb5:lb3

seanyoung (Wed, 08 Jul 2020 13:22:45 GMT):
`git push -f hype_labs lb5:lb3`

seanyoung (Wed, 08 Jul 2020 13:23:06 GMT):
(that means lb5 local becomes lb3 remote)

seanyoung (Wed, 08 Jul 2020 13:23:14 GMT):
The PR should update instantly

sbalikondwar (Wed, 08 Jul 2020 13:38:12 GMT):
done

sbalikondwar (Wed, 08 Jul 2020 13:39:13 GMT):
thanks a lot for the help, i surely took a lot of your time

seanyoung (Wed, 08 Jul 2020 13:40:28 GMT):
Thank you for your work, it looks great!

sbalikondwar (Wed, 08 Jul 2020 13:43:11 GMT):
Will go for some break

sbalikondwar (Wed, 08 Jul 2020 13:43:38 GMT):
You too 👍

seanyoung (Wed, 08 Jul 2020 13:46:40 GMT):
Looks great, I've merged it!

sbalikondwar (Wed, 08 Jul 2020 13:49:31 GMT):
Great

seanyoung (Wed, 08 Jul 2020 13:53:14 GMT):
So I think we're good for eval 1.

seanyoung (Wed, 08 Jul 2020 13:56:04 GMT):
Now we'll be look at the rust side more. rust has some features which make it very different from other languages. It might be interesting to read: https://doc.rust-lang.org/stable/book/ch04-00-understanding-ownership.html Also, the AST is stored in a big struct/enum. In rust, you walk such a structure with pattern matching. https://doc.rust-lang.org/stable/book/ch06-00-enums.html (chapter 5 is also good)

sbalikondwar (Thu, 09 Jul 2020 14:54:56 GMT):
good evening

sbalikondwar (Thu, 09 Jul 2020 14:55:41 GMT):
was a bit busy today, will go through the above resources and simultaneously work on the monday inputs

sbalikondwar (Thu, 09 Jul 2020 15:01:47 GMT):
from our hyperledger mentee group I got the info that the mentor sends the report to the organiser, can you confirm it with Min @seanyoung

seanyoung (Thu, 09 Jul 2020 15:02:20 GMT):
Yes, that's right. Will do

sbalikondwar (Thu, 09 Jul 2020 15:02:39 GMT):
thanks

sbalikondwar (Fri, 10 Jul 2020 15:29:48 GMT):
good evening

seanyoung (Fri, 10 Jul 2020 15:29:54 GMT):
Hello

sbalikondwar (Fri, 10 Jul 2020 15:30:09 GMT):
was updaing rust using rustup

sbalikondwar (Fri, 10 Jul 2020 15:31:11 GMT):
updating the solang and working on those links

sbalikondwar (Fri, 10 Jul 2020 15:31:47 GMT):
have you included any doc about how to run the ast implementation @seanyoung ?

seanyoung (Fri, 10 Jul 2020 15:33:20 GMT):
There is only documentation on using Solang from the command line, nothing about using Solang like those.

seanyoung (Fri, 10 Jul 2020 15:33:20 GMT):
There is only documentation on using Solang from the command line, nothing about using Solang like this.

seanyoung (Fri, 10 Jul 2020 15:33:53 GMT):
I can put something together. What do you have in mind?

seanyoung (Fri, 10 Jul 2020 15:34:03 GMT):
More docs is always good!

sbalikondwar (Fri, 10 Jul 2020 15:34:23 GMT):
nothing i was just interested to see if it is possible to print the ast

sbalikondwar (Fri, 10 Jul 2020 15:34:37 GMT):
just being curious

seanyoung (Fri, 10 Jul 2020 15:34:53 GMT):
ah printing the ast. Yes, I haven't done that yet. That would be useful.

sbalikondwar (Fri, 10 Jul 2020 15:35:19 GMT):
not a hurry, i might try it myself

seanyoung (Fri, 10 Jul 2020 15:35:55 GMT):
I find it hard decide what would be good way to print it. I worry it is just going to look like a mess and not very readable.

seanyoung (Fri, 10 Jul 2020 15:36:12 GMT):
Maybe we could just try something and see how it works out

sbalikondwar (Fri, 10 Jul 2020 15:36:24 GMT):
yeah true, AST is quite big and not the best to print on screen

sbalikondwar (Fri, 10 Jul 2020 15:36:50 GMT):
sure, ok

sbalikondwar (Mon, 13 Jul 2020 15:22:40 GMT):
good evening

seanyoung (Mon, 13 Jul 2020 15:34:54 GMT):
good evening @sbalikondwar

sbalikondwar (Mon, 13 Jul 2020 15:36:05 GMT):
i think the eval was passed

sbalikondwar (Mon, 13 Jul 2020 15:36:15 GMT):
thanks for submitting the feedback

seanyoung (Mon, 13 Jul 2020 15:36:18 GMT):
great!

sbalikondwar (Mon, 13 Jul 2020 15:37:05 GMT):
i recieved some approvals on the reports so we should not focus on it more

sbalikondwar (Mon, 13 Jul 2020 15:37:47 GMT):
finished reading the stuff, went all the way to lifetimes, some things can be surprising like ownership

sbalikondwar (Mon, 13 Jul 2020 15:38:13 GMT):
should look into the solang code, I was busy a bit for the weekend

sbalikondwar (Mon, 13 Jul 2020 15:38:24 GMT):
how are you doing?

sbalikondwar (Mon, 13 Jul 2020 15:39:12 GMT):
here the authorities reimposed a small lockdown for 10 days

sbalikondwar (Mon, 13 Jul 2020 15:39:48 GMT):
It won't affect the work, but the cases were increasing and better to take precautions

seanyoung (Mon, 13 Jul 2020 15:42:40 GMT):
I'm fine

seanyoung (Mon, 13 Jul 2020 15:43:58 GMT):
Oh dear, small lockdown, that doesn't sound good. Hope things aren't too bad. Can you go out for shopping etc?

sbalikondwar (Mon, 13 Jul 2020 15:48:05 GMT):
We have stockpiled for month so everything is good

seanyoung (Mon, 13 Jul 2020 15:55:44 GMT):
Oh wow, good to hear you're prepared!

seanyoung (Mon, 13 Jul 2020 15:57:19 GMT):
I'm trying to add `import` statements to Solang. They need to be added to the AST. I'm not sure yet what the best representation should be, but the AST will have to change.

sbalikondwar (Mon, 13 Jul 2020 15:59:01 GMT):
Yeah I am looking into it and will also check if I can find any example for reference

sbalikondwar (Mon, 13 Jul 2020 15:59:01 GMT):
Yeah I am looking into the Solang implementation and will also check if I can find any example for reference

sbalikondwar (Mon, 13 Jul 2020 16:00:18 GMT):
Perhaps we can discuss in Wednesdays meet

seanyoung (Mon, 13 Jul 2020 16:01:15 GMT):
Good idea

seanyoung (Mon, 13 Jul 2020 16:02:14 GMT):
The weird thing is that you can have a file a.sol that import b.sol, and then b.sol imports a.sol and it works! I thought that should fail with infinite recursion.

sbalikondwar (Tue, 14 Jul 2020 13:38:57 GMT):
good evening

seanyoung (Tue, 14 Jul 2020 18:55:24 GMT):
Hello @sbalikondwar sorry I was distracted this afternoon

sbalikondwar (Tue, 14 Jul 2020 19:00:31 GMT):
No problem, see you tomorrow

sbalikondwar (Wed, 15 Jul 2020 10:34:07 GMT):
good afternoon

sbalikondwar (Wed, 15 Jul 2020 10:34:17 GMT):
we have meet in one hour

seanyoung (Wed, 15 Jul 2020 10:34:20 GMT):
good afternoon

seanyoung (Wed, 15 Jul 2020 10:34:30 GMT):
yes, that's right

sbalikondwar (Wed, 15 Jul 2020 10:34:46 GMT):
i mean as per the time of the last couple of meets

seanyoung (Wed, 15 Jul 2020 10:35:07 GMT):
is the same time ok for you?

sbalikondwar (Wed, 15 Jul 2020 10:35:47 GMT):
yeah 5PM IST, do you want any other time?

sbalikondwar (Wed, 15 Jul 2020 10:35:59 GMT):
5:00 pm Wednesday, Indian Standard Time (IST) is 12:30 pm Wednesday, British Summer Time (BST)

seanyoung (Wed, 15 Jul 2020 10:36:11 GMT):
that time is good for me

sbalikondwar (Wed, 15 Jul 2020 10:36:39 GMT):
cool

seanyoung (Wed, 15 Jul 2020 11:42:55 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/output.rs#L5

seanyoung (Wed, 15 Jul 2020 11:43:18 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/output.rs#L28

seanyoung (Thu, 16 Jul 2020 12:45:26 GMT):
Hi @sbalikondwar I've merged the changed for `import` statements. This changes the interface to solang somewhat, since now multiple files might be needed to compile a solidity file. These files do not have the reside on disk, so the `parse_and_resolve` function now takes a `FileCache`. You can add files to the cache or set an import path, in which case files can be loaded from disk. The solang tests use solang as a crate, just like we were planning for the language server. This is an example: https://github.com/hyperledger-labs/solang/blob/master/tests/substrate_imports/mod.rs#L9 Not sure about the name `FileCache`. Please let us know if we can improve this in any way for the language server.

sbalikondwar (Thu, 16 Jul 2020 12:52:59 GMT):
Ok I'll look at that

sbalikondwar (Fri, 17 Jul 2020 15:36:34 GMT):
thanks a lot changes are very useful

sbalikondwar (Fri, 17 Jul 2020 15:36:34 GMT):
thanks a lot, the changes to parse_and_resolve and file feature addition are very useful

sbalikondwar (Fri, 17 Jul 2020 15:36:50 GMT):
yeah name can be changes as per use

sbalikondwar (Fri, 17 Jul 2020 15:36:50 GMT):
yeah name can be changed as per use

sbalikondwar (Fri, 17 Jul 2020 15:36:54 GMT):
good evening

sbalikondwar (Fri, 17 Jul 2020 15:37:26 GMT):
was busy with some work so was able to give only little time

sbalikondwar (Fri, 17 Jul 2020 15:37:26 GMT):
was busy with some work so was able to give only little time yesterday

sbalikondwar (Fri, 17 Jul 2020 15:38:19 GMT):
turns out staying home in lockdown can turn you lazy

KiChjang (Sun, 19 Jul 2020 00:19:44 GMT):
Has joined the channel.

KiChjang (Sun, 19 Jul 2020 00:19:44 GMT):
hi @seanyoung, I'm the person working on supporting dynamic array push and pop

KiChjang (Sun, 19 Jul 2020 00:20:24 GMT):
I'm still stuck on trying to figure out how exactly I'm supposed to reassign the array after calling realloc

KiChjang (Sun, 19 Jul 2020 00:23:07 GMT):
I did manage to fix the build issue however; it's as simple as cloning the LLVM project and building it myself under WSL

KiChjang (Sun, 19 Jul 2020 06:19:30 GMT):
Ok, i took a look again, and it does look like that i need to ensure that the variable table is passed in mutably in order to reassign the existing array

seanyoung (Sun, 19 Jul 2020 08:56:31 GMT):
Hi @KiChjang Are you talking about the code emitter in https://github.com/hyperledger-labs/solang/blob/master/src/emit/mod.rs#L762 or do you mean in the resolver/sema https://github.com/hyperledger-labs/solang/blob/master/src/sema/expression.rs#L1006

seanyoung (Sun, 19 Jul 2020 09:01:05 GMT):
Actually, you might be stuck on the expression emitter. There is something I had not thought of. After codegen, expressions may only read variables, not write variables. Only instructions can write to variables. So for push/pop expressions, there are two way of doing this: 1. Make push/pop return the new value of the array, and wrap the push/pop in a Set instruction, like is done here for simple variable assignment: https://github.com/hyperledger-labs/solang/blob/master/src/codegen/expression.rs#L858 2. Rather than making push/pop on memory areas an expression, create a new push/pop instruction to handle this.

KiChjang (Sun, 19 Jul 2020 09:23:09 GMT):
hmm ok, that means the push/pop operations will have a slightly different semantics

KiChjang (Sun, 19 Jul 2020 09:23:22 GMT):
i don't think i can do the 1st open with pop

KiChjang (Sun, 19 Jul 2020 09:23:22 GMT):
i don't think i can do the 1st option with pop

KiChjang (Sun, 19 Jul 2020 09:23:44 GMT):
because you do expect the return value to be the the last element that got popped

seanyoung (Sun, 19 Jul 2020 09:24:39 GMT):
@KiChjang that is a good point, yes you are right.

KiChjang (Sun, 19 Jul 2020 09:30:43 GMT):
hmm... how does a normal compilation flow look like? does codegen happen before emission or is it the other way around?

KiChjang (Sun, 19 Jul 2020 09:38:26 GMT):
ah ok, codegen happens first

seanyoung (Sun, 19 Jul 2020 09:40:22 GMT):
first sema checks the parse tree and generates the AST. The AST has fully resolved expressions and statements, but structurally it's the same as the source code. Then codegen generates actual code in the form of instructions, lastly emit transforms the output from codegen into llvm.

seanyoung (Sun, 19 Jul 2020 09:40:57 GMT):
An codegen instruction can have multiple output fields. For example, an external call both has output for whether the call succeeded or not, and the return value from the call.

sbalikondwar (Sun, 19 Jul 2020 19:00:20 GMT):

IMG20200720002920.jpg

sbalikondwar (Sun, 19 Jul 2020 19:04:34 GMT):

dir str.jpg

sbalikondwar (Sun, 19 Jul 2020 19:08:16 GMT):
In the middle of the work i just forgot to post the dir structure

sbalikondwar (Sun, 19 Jul 2020 19:10:11 GMT):
├── solang-server │   ├── Cargo.lock │   ├── Cargo.toml │   ├── src │   └── target └── solang-vscode ├── CHANGELOG.md ├── LICENSE ├── node_modules ├── out ├── package.json ├── package-lock.json ├── README.md ├── snippets ├── solidity.configuration.json ├── src ├── syntaxes ├── tsconfig.json └── vsc-extension-quickstart.md Oh i just discovered there is tree command in terminal

KiChjang (Mon, 20 Jul 2020 04:09:41 GMT):
I wonder how you're able to call an external function like `__realloc` during codegen

KiChjang (Mon, 20 Jul 2020 04:10:08 GMT):
it doesn't look possible to me, but it seems like this is essential if we want to instead emit an instruction for dynamic array push/pop

seanyoung (Mon, 20 Jul 2020 07:53:39 GMT):
@sbalikondwar that looks like it makes sense, we'll look at it in detail during merge review

seanyoung (Mon, 20 Jul 2020 07:54:38 GMT):
@KiChjang during codegen there is no llvm context and it makes no sense to call `__realloc`. codegen must generate instructions and expresssions that will cause emit to generate the correct code.

seanyoung (Mon, 20 Jul 2020 07:56:19 GMT):
@KiChjang maybe if you explain in detail what you're trying to do we can work it out

KiChjang (Mon, 20 Jul 2020 07:56:42 GMT):
i'm unsure how that would work, how can codegen generate an instruction that depends on the result of the emitter?

seanyoung (Mon, 20 Jul 2020 08:28:10 GMT):
For push and pop, you could have an instruction for this. So here https://github.com/hyperledger-labs/solang/blob/master/src/codegen/cfg.rs#L13 add: ``` PushMemory { res: usize, ty: Type, array: usize, value: Expression } ``` Now codegen so generate this instruction so that `array` contains the array variable and res the reference to the new value. Expression is the value to be pushed or zero/default value if push was called with no arg. Then in codegen return an expression to the variable res (this should be a temporary variable). In emit, this instruction will call `__realloc` while reading/writing array variable. new value needs to be written and res needs to be set.

KiChjang (Mon, 20 Jul 2020 08:58:05 GMT):
ah ok, i think i'm starting to see how it's done... the emitter has a `emit_cfg` function, and this will be where we can add logic to reassigning the array pointer

seanyoung (Mon, 20 Jul 2020 09:18:42 GMT):
Yes, that's right.

sbalikondwar (Mon, 20 Jul 2020 13:23:00 GMT):
yeah that's fine, good evening

seanyoung (Mon, 20 Jul 2020 13:37:20 GMT):
good evening @sbalikondwar

sbalikondwar (Mon, 20 Jul 2020 14:31:07 GMT):
so i have one doubt

sbalikondwar (Mon, 20 Jul 2020 14:31:40 GMT):
in filecache are we going to require all files to be extracted and stored in it?

sbalikondwar (Mon, 20 Jul 2020 14:31:55 GMT):
https://github.com/hyperledger-labs/solang/blob/master/tests/substrate_imports/mod.rs#L11

sbalikondwar (Mon, 20 Jul 2020 14:32:18 GMT):
like here when there is already a.sol do i need to extract a.sol and add it in cache

sbalikondwar (Mon, 20 Jul 2020 14:32:58 GMT):
or will None work as an cache argument for parse_and_resolve

seanyoung (Mon, 20 Jul 2020 14:33:34 GMT):
`None` only works in rust if the argument is an `Option`

sbalikondwar (Mon, 20 Jul 2020 14:33:58 GMT):
my mistake

seanyoung (Mon, 20 Jul 2020 14:34:01 GMT):
so you can create file cache object and then set an import path. Then the file will be loaded automatically from the path

seanyoung (Mon, 20 Jul 2020 14:34:42 GMT):
This is what the solang binary does https://github.com/hyperledger-labs/solang/blob/master/src/bin/solang.rs#L115

seanyoung (Mon, 20 Jul 2020 14:35:16 GMT):
it does not populate the cache, it just tells it where to load files from, and they're loaded and cached.

seanyoung (Mon, 20 Jul 2020 14:35:56 GMT):
so later when error messages are printed, file offsets have to be converted into line numbers and column numbers. The same cache is used for that so it does not have to load the same files again

seanyoung (Mon, 20 Jul 2020 14:36:35 GMT):
in tests the files are not actual files on disk so this can't be done

seanyoung (Mon, 20 Jul 2020 14:37:02 GMT):
would setting the import path on a file cache work for the language server?

sbalikondwar (Mon, 20 Jul 2020 14:41:45 GMT):
i am working on it, but should work since it is just a mechanism to speed up work

sbalikondwar (Mon, 20 Jul 2020 14:42:19 GMT):
yes

sbalikondwar (Mon, 20 Jul 2020 14:43:22 GMT):
going for a short dinner break will be back in sometime

seanyoung (Tue, 21 Jul 2020 07:40:06 GMT):
Good afternoon @sbalikondwar I've renamed the diagnostic struct `Output` to `Diagnostic` https://github.com/hyperledger-labs/solang/commit/7f8d1d7c79ca6d7464099ce324f4eae487ec4c14 and moved it into the sema module https://github.com/hyperledger-labs/solang/commit/f5c5e5f17762f6737b8526e1193e430a551c131d Hope that make sense

sbalikondwar (Tue, 21 Jul 2020 11:07:59 GMT):
good evening

KiChjang (Wed, 22 Jul 2020 03:55:16 GMT):
I have a feeling that I need to add some new functions to `stdlib.c` in order to support array pushes, because if i'm reading this correctly, ALL kinds of dynamic arrays are represented as a `struct vector*` in C

KiChjang (Wed, 22 Jul 2020 03:57:19 GMT):
and if that's the case, then it's much better to just implement the push logic inside stdlib instead since most of the code in trying to reallocate and create a new vector is very similar to `vector_new`

KiChjang (Wed, 22 Jul 2020 05:16:17 GMT):
ok, it looks like this is more complicated than i thought... arrays that are declared with the `new` keyword like `new int[](1)` will use the `struct vector` representation, whereas those that use array literals would just be alloc'd with `malloc`

seanyoung (Wed, 22 Jul 2020 08:17:00 GMT):
@KiChjang both of those end up calling malloc

KiChjang (Wed, 22 Jul 2020 08:17:23 GMT):
yes, but the in-memory representation of it is different

KiChjang (Wed, 22 Jul 2020 08:17:59 GMT):
the one from the new keyword returns a struct vector pointer, whereas the other one is just a contiguous memory of bytes

seanyoung (Wed, 22 Jul 2020 08:18:20 GMT):
an array literal will be a fixed-sized array, not a dynamic array

KiChjang (Wed, 22 Jul 2020 08:19:06 GMT):
ok, in other words, we can't just call `realloc` on a dynamic array

seanyoung (Wed, 22 Jul 2020 08:19:39 GMT):
dynamic array is a vector allocated with malloc

KiChjang (Wed, 22 Jul 2020 08:19:52 GMT):
there are fields on the struct whose values need to be preserved

seanyoung (Wed, 22 Jul 2020 08:20:08 GMT):
vector_new() is just a convenience function which calls malloc and sets up some members

KiChjang (Wed, 22 Jul 2020 08:21:33 GMT):
if you call realloc on a struct vector pointer, the field values on the struct doesn't get preserved, correct?

seanyoung (Wed, 22 Jul 2020 08:23:27 GMT):
if you call recall() on an object returned from malloc(), then if the new size is larger then the existing fields will be preserved. If the new size is smaller than then some fields will be truncated.

seanyoung (Wed, 22 Jul 2020 08:23:49 GMT):
realloc() resizes a memory object and preserves its content.

seanyoung (Wed, 22 Jul 2020 08:26:01 GMT):
@sbalikondwar are you okay to do our 12:30 BST call today?

KiChjang (Wed, 22 Jul 2020 08:26:14 GMT):
ok, then it looks to me the problem now is to access the `data` section of the vector, and write the newest element to it

seanyoung (Wed, 22 Jul 2020 08:26:38 GMT):
yes, that is right.

KiChjang (Wed, 22 Jul 2020 08:26:52 GMT):
how would i do that in the rust code?

KiChjang (Wed, 22 Jul 2020 08:27:14 GMT):
wait, i think i get it

KiChjang (Wed, 22 Jul 2020 08:27:16 GMT):
gep

KiChjang (Wed, 22 Jul 2020 08:39:39 GMT):
i'm just a bit surprised however, because this means we'll always need to keep the ABI/memory layout in mind when we're emitting code related to arrays

KiChjang (Wed, 22 Jul 2020 08:39:39 GMT):
i'm just a bit surprised however, because this means we'll always need to keep the ABI/memory layout in mind when we're emitting code related to dynamic arrays

sbalikondwar (Wed, 22 Jul 2020 08:57:06 GMT):
@seanyoung sure the meet will be as always

sbalikondwar (Wed, 22 Jul 2020 08:58:15 GMT):
good afternoon

seanyoung (Wed, 22 Jul 2020 09:47:49 GMT):
@sbalikondwar perfect :) good afternoon

sbalikondwar (Wed, 22 Jul 2020 11:33:44 GMT):
fn convert_diagnos(ns: ast::Namespace) -> Vec { let diagnostic = ns.diagnostic[0]; let mut diagnostic_arr = Vec::new(); let p1 = Position {line:1, character:1}; let p2 = Position {line:1,character:2}; let range = Range { p1, p2 }; let sev = match diagnostic.level { DiagnosticSeverity::Error => DiagnosticSeverity::Information, DiagnosticSeverity::Warning => DiagnosticSeverity::Warning, DiagnosticSeverity::Information => DiagnosticSeverity::Error, }; let diagnostic_msg = diagnostic.message; diagnostic_arr.push(Diagnostic { range, message: diagnostic_msg, severity: Some(sev), source: Some("solidity".to_string()), code: None, related_information: None, tags: None, }); diagnostic_arr }

sbalikondwar (Wed, 22 Jul 2020 11:33:59 GMT):
async fn did_change(&self, client: &Client, params : DidChangeTextDocumentParams) { client.log_message(MessageType::Info, "file changed!"); let uri = params.text_document.uri; let text = ¶ms.content_changes[0].text; //self.update(uri.clone(), text).await; client.publish_diagnostics(uri.clone(), self.get_diagnostics(&uri, text), None); }

sbalikondwar (Wed, 22 Jul 2020 11:39:30 GMT):
https://docs.rs/lsp-types/0.77.0/lsp_types/struct.Range.html

seanyoung (Wed, 22 Jul 2020 11:40:06 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/diagnostics.rs#L242

seanyoung (Wed, 22 Jul 2020 11:40:34 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/diagnostics.rs#L151

KiChjang (Wed, 22 Jul 2020 21:57:12 GMT):
@seanyoung I just pushed a commit to implement dynamic array pushes, but the unit test I added is still failing for me, have I done anything wrong in the emitter?

KiChjang (Wed, 22 Jul 2020 21:57:16 GMT):
https://github.com/KiChjang/solang/commit/5a3b04c92084b2c899d97224b08d1585b8772819

KiChjang (Wed, 22 Jul 2020 21:57:29 GMT):
it looks like the errors i'm receiving is about an invalid memory region access

KiChjang (Thu, 23 Jul 2020 05:20:23 GMT):
I see what I'm missing now, the len and size field of the vector struct needs to be updated

seanyoung (Thu, 23 Jul 2020 10:59:00 GMT):
@KiChjang just looked at your commit. I haven't looked at it in detail but it looks like you're in on the right track.

KiChjang (Thu, 23 Jul 2020 10:59:43 GMT):
i still don't get why my unit tests are failing though... i thought it was the length and size issue, but it isn't

seanyoung (Thu, 23 Jul 2020 11:00:50 GMT):
I'm afraid I don't have much time today, hopefully I'll have some time tomorrow to go through it in detail

KiChjang (Thu, 23 Jul 2020 11:01:09 GMT):
ok gotcha

sbalikondwar (Fri, 24 Jul 2020 14:18:08 GMT):
good evening

sbalikondwar (Fri, 24 Jul 2020 14:18:26 GMT):
was busy yesterday so will be working through the weekend

seanyoung (Fri, 24 Jul 2020 21:02:34 GMT):
@sbalikondwar good evening I was thinking about converting file offsets to line number/column number. The current code creates an ordered list of offsets at which newlines occur. Then, convert() does a linear scan through this array to find the correct line. It might be possible to be faster and use binary search. I haven't tried it though, just an idea. Not really needed.

KiChjang (Sat, 25 Jul 2020 03:39:35 GMT):
@seanyoung were you able to find time to look deeper into the commit i linked about?

seanyoung (Sat, 25 Jul 2020 08:43:43 GMT):
@KiChjang sorry yesterday I had to work on other things. I've just taken a better look. It looks like it's nearly there!

seanyoung (Sat, 25 Jul 2020 08:49:05 GMT):
So there a few issues which case the assert to fail in the test. 1. The length of the array is dynamic, so this has to be loaded from the vector. This is how you load the array length: https://github.com/hyperledger-labs/solang/blob/master/src/emit/mod.rs#L1688 2. The new length needs to be written to the array, use build_gep() like you used for loading the length with build_store(). This needs to be a new build_gep() since the array pointer might have changed.

seanyoung (Sat, 25 Jul 2020 08:50:14 GMT):
So Expression::DynamicArrayPush() cannot have a length element since you do not know the length at compile time.

seanyoung (Sat, 25 Jul 2020 08:50:22 GMT):
Same for the instruction.

seanyoung (Sat, 25 Jul 2020 08:50:36 GMT):
Great progress though please let me know how you get on.

sbalikondwar (Sat, 25 Jul 2020 12:05:31 GMT):
good evening

sbalikondwar (Sat, 25 Jul 2020 12:05:59 GMT):
so i was looking into fileposition which will be used to fill in range field of diagnostic of jsonrpc

sbalikondwar (Sat, 25 Jul 2020 12:06:18 GMT):
but i dont see it being present in diagnostic nor namespace

sbalikondwar (Sat, 25 Jul 2020 12:06:18 GMT):
but i dont see it being present in diagnostic nor namespace where i can access it

sbalikondwar (Sat, 25 Jul 2020 12:10:15 GMT):
oh i see it can be accesed using get_file_contents from filecache and then use convert

sbalikondwar (Sat, 25 Jul 2020 12:10:19 GMT):
no problem

seanyoung (Sat, 25 Jul 2020 12:13:12 GMT):
ah I don't think it is pub

seanyoung (Sat, 25 Jul 2020 12:14:04 GMT):
It probably should be made pub and given a better name

sbalikondwar (Sat, 25 Jul 2020 12:28:21 GMT):
yes should be public

sbalikondwar (Sat, 25 Jul 2020 12:28:39 GMT):
well i will look if i can do local changes

sbalikondwar (Sat, 25 Jul 2020 12:29:58 GMT):
anyway for the time being i can try a dummy value cause the range field isn't that important

sbalikondwar (Sat, 25 Jul 2020 12:33:46 GMT):
for now i would say the we should do changes on solang sometime later , like a final refactor

sbalikondwar (Sat, 25 Jul 2020 12:34:42 GMT):
cause the requirements can change slightly from time to time

sbalikondwar (Sat, 25 Jul 2020 14:31:58 GMT):
i am little confused here rror[E0507]: cannot move out of `diagnostic.message` which is behind a shared reference --> examples/server_eg.rs:74:22 | 74 | message: diagnostic.message, | ^^^^^^^^^^^^^^^^^^ move occurs because `diagnostic.message` has type `std::string::String`, which does not implement the `Copy` trait

sbalikondwar (Sat, 25 Jul 2020 14:39:08 GMT):
oh yes i forgot about slices :sweat_smile:

sbalikondwar (Sat, 25 Jul 2020 14:52:13 GMT):
took a trial run of the implementation, there seems to be some problem with file paths and how they are imported but i got one problem message as diagnostic

sbalikondwar (Sat, 25 Jul 2020 14:52:43 GMT):

Screenshot from 2020-07-25 20-22-20.png

sbalikondwar (Sat, 25 Jul 2020 14:52:50 GMT):

Screenshot from 2020-07-25 20-22-23.png

sbalikondwar (Sat, 25 Jul 2020 14:55:40 GMT):
the message is from v

sbalikondwar (Sat, 25 Jul 2020 14:55:40 GMT):
the message is from https://github.com/hyperledger-labs/solang/blob/master/src/file_cache.rs#L104

sbalikondwar (Sat, 25 Jul 2020 14:57:17 GMT):
i should work on fixing them by understanding the paths, going off for some time for dinner

sbalikondwar (Sat, 25 Jul 2020 14:59:23 GMT):
anyways how is the weather there, it was raining today

sbalikondwar (Sat, 25 Jul 2020 15:02:14 GMT):
I hope i could have found this article early https://www.forbes.com/sites/jacquelynsmith/2013/02/22/14-things-successful-people-do-on-weekends/#67ca5d83f767

seanyoung (Sat, 25 Jul 2020 17:39:32 GMT):
@sbalikondwar great to see an error message come through! I'm guessing there is an issue with how the path is passed. What is the uri set to?

sbalikondwar (Sat, 25 Jul 2020 17:46:25 GMT):
just a min will add a console message and check

sbalikondwar (Sat, 25 Jul 2020 17:50:31 GMT):
file:///home/hyperion/intern/hyperledger/sls/practice/slang-ex/flipper.sol is the uri and i am stripping it to send flipper.sol as the filename

sbalikondwar (Sat, 25 Jul 2020 17:52:43 GMT):
wait to i need to populate cache after i do add_import_path ?

seanyoung (Sat, 25 Jul 2020 17:53:01 GMT):
what do you set the import path to?

seanyoung (Sat, 25 Jul 2020 17:53:12 GMT):
it should be "/home/hyperion/intern/hyperledger/sls/practice/slang-ex"

seanyoung (Sat, 25 Jul 2020 17:53:50 GMT):
or you can set the contents with cache.set_file_contents()

sbalikondwar (Sat, 25 Jul 2020 17:54:03 GMT):
let mut file_cache = FileCache::new(); file_cache.add_import_path(path); let uri_string = uri.to_string(); client.log_message(MessageType::Info, &uri_string); let path_vec: Vec<&str> = uri_string.rsplit('/').collect(); let ns = parse_and_resolve(path_vec[0], &mut file_cache, Target::Ewasm); let d = Backend::convert_diagnos(ns); client.publish_diagnostics(uri, d, None);

seanyoung (Sat, 25 Jul 2020 17:54:08 GMT):
I'll have a look at that article about what to do at the weekend later :)

sbalikondwar (Sat, 25 Jul 2020 17:54:11 GMT):
this is the implementation

seanyoung (Sat, 25 Jul 2020 17:55:00 GMT):
what is path to set to?

sbalikondwar (Sat, 25 Jul 2020 17:55:20 GMT):
file:///home/hyperion/intern/hyperledger/sls/practice/slang-ex/flipper.sol

sbalikondwar (Sat, 25 Jul 2020 17:55:42 GMT):
ah wait

sbalikondwar (Sat, 25 Jul 2020 17:56:06 GMT):
if let Ok(path) = uri.to_file_path() { let mut file_cache = FileCache::new();

sbalikondwar (Sat, 25 Jul 2020 17:56:32 GMT):
https://docs.rs/url/2.1.0/url/struct.Url.html#method.to_file_path

sbalikondwar (Sat, 25 Jul 2020 17:57:52 GMT):
this was the uri

sbalikondwar (Sat, 25 Jul 2020 17:57:52 GMT):
this was the uri file:///home/hyperion/intern/hyperledger/sls/practice/slang-ex/flipper.sol

seanyoung (Sat, 25 Jul 2020 17:59:34 GMT):
ok then the filename will be path.file_name() and the import path should be set to path.parent()

seanyoung (Sat, 25 Jul 2020 18:00:05 GMT):
It's better to use pathbuf methods rather than doing string processing yourself.

sbalikondwar (Sat, 25 Jul 2020 18:00:49 GMT):
yeah, I agree only i was unware of the methods

sbalikondwar (Sat, 25 Jul 2020 18:00:49 GMT):
yeah, I agree i was unware of the methods

sbalikondwar (Sat, 25 Jul 2020 18:01:12 GMT):
anyways I will look and fix those things, better not disturb you on weekends

seanyoung (Sat, 25 Jul 2020 18:01:45 GMT):
Don't worry about that, happy to help :)

sbalikondwar (Sat, 25 Jul 2020 18:02:21 GMT):
ok so its quite dark here will work for sometime and log off, see you tomorrow if you are available!

seanyoung (Sat, 25 Jul 2020 18:07:17 GMT):
see you tomorrow, I'll be painting my kitchen but available otherwise

sbalikondwar (Sat, 25 Jul 2020 18:12:58 GMT):
Sounds interesting, sure

KiChjang (Sat, 25 Jul 2020 22:11:42 GMT):
pfff, I really brainfarted on this one, of course it's dynamic! thanks for being an extra pair of eyes

KiChjang (Sun, 26 Jul 2020 03:20:46 GMT):
@seanyoung I think I'm almost there with push, the remaining problem i found was when I tried to test it with struct arrays

KiChjang (Sun, 26 Jul 2020 03:21:31 GMT):
the problem i'm encountering specifically now is I'm not sure if I'm supposed to store a struct as opposed to a pointer to a struct

seanyoung (Sun, 26 Jul 2020 09:34:02 GMT):
@KiChjang can you show me what you mean in the code? Thanks

sbalikondwar (Sun, 26 Jul 2020 16:41:26 GMT):
ok looks like the server is responding for some changes

sbalikondwar (Sun, 26 Jul 2020 16:41:46 GMT):

Screenshot from 2020-07-26 22-09-20.png

sbalikondwar (Sun, 26 Jul 2020 16:42:03 GMT):

Screenshot from 2020-07-26 22-11-02.png

sbalikondwar (Sun, 26 Jul 2020 16:43:20 GMT):
there are some things which I want a suggestion on, for today I will be taking the day off

sbalikondwar (Sun, 26 Jul 2020 16:43:46 GMT):
tomorrow i can upload the changes on my branch and we can workout the suggestions

sbalikondwar (Sun, 26 Jul 2020 16:46:47 GMT):
might watch a movie! 🍿🎥 , see you tomorrow. by the way how did painting went

sbalikondwar (Sun, 26 Jul 2020 16:46:47 GMT):
might watch a movie! 🍿🎥 , see you tomorrow. by the way how was painting?

seanyoung (Sun, 26 Jul 2020 20:41:57 GMT):
Great to see diagnostics coming through! Painting was tiring, so much prep to do! Still not started the painting itself. What movie did you see?

sbalikondwar (Sun, 26 Jul 2020 20:48:19 GMT):
https://g.co/kgs/7Lk5EQ

sbalikondwar (Sun, 26 Jul 2020 20:48:19 GMT):
https://g.co/kgs/7Lk5EQ Greyhound

sbalikondwar (Sun, 26 Jul 2020 20:52:41 GMT):
Movie was great 👍. Painting sure takes time. I am going to log off.

sbalikondwar (Sun, 26 Jul 2020 20:52:41 GMT):
Movie was great 👍. Painting sure takes time. I am going to log off, night.

sbalikondwar (Sun, 26 Jul 2020 20:52:41 GMT):
Movie was great 👍. Painting sure takes time. I am going to log off, good night.

KiChjang (Sun, 26 Jul 2020 22:18:23 GMT):
@seanyoung This is what I'm talking about before: https://github.com/KiChjang/solang/commit/00f7ca2fda2f2d0dcb2efc38107271706cb143c4#diff-87f147c2d21757d7c3161a722a305b7eR3103

KiChjang (Sun, 26 Jul 2020 22:18:40 GMT):
When a struct literal is allocated, a pointer to this struct is returned

KiChjang (Sun, 26 Jul 2020 22:19:08 GMT):
so i'm not sure if the array should store pointers to a struct, or the struct themselves

KiChjang (Sun, 26 Jul 2020 22:19:53 GMT):
but from my reading, it does look like the dynamic array stores pointer-to-structs instead of structs

KiChjang (Sun, 26 Jul 2020 22:20:31 GMT):
if that's the case, then I don't know why my commit fails the unit test that I created

knagware9 (Mon, 27 Jul 2020 04:27:26 GMT):
Has left the channel.

sbalikondwar (Mon, 27 Jul 2020 14:34:06 GMT):
good evening

sbalikondwar (Mon, 27 Jul 2020 16:04:28 GMT):
Doing some clean up today

seanyoung (Mon, 27 Jul 2020 17:04:43 GMT):
Hi @sbalikondwar Sorry I was busy today, more painting. :) I might watch greyhound, something to watch to relax :)

seanyoung (Mon, 27 Jul 2020 17:04:43 GMT):
Hi @sbalikondwar Sorry I was busy today, more painting. I might watch greyhound, something to watch to relax :)

sbalikondwar (Mon, 27 Jul 2020 19:30:10 GMT):
No problem I hope you enjoy it

sbalikondwar (Mon, 27 Jul 2020 19:30:38 GMT):
Today was doing the code refactoring and fell asleep for some time

sbalikondwar (Mon, 27 Jul 2020 19:30:45 GMT):
See you tomorrow

sbalikondwar (Tue, 28 Jul 2020 09:02:35 GMT):
@seanyoung good morning

seanyoung (Tue, 28 Jul 2020 09:02:46 GMT):
good morning!

sbalikondwar (Tue, 28 Jul 2020 09:02:58 GMT):
Do you have any resource to know the crate and mod structure

sbalikondwar (Tue, 28 Jul 2020 09:03:30 GMT):
I was just re arranging the files and got confused there

sbalikondwar (Tue, 28 Jul 2020 09:03:30 GMT):
I was just re arranging the rust crate files and got confused there

seanyoung (Tue, 28 Jul 2020 09:04:31 GMT):
https://doc.rust-lang.org/book/ch07-00-managing-growing-projects-with-packages-crates-and-modules.html

sbalikondwar (Tue, 28 Jul 2020 09:05:05 GMT):
:thumbsup:

seanyoung (Tue, 28 Jul 2020 09:05:25 GMT):
let me know if you're still stuck after reading that

KiChjang (Tue, 28 Jul 2020 09:18:14 GMT):
@seanyoung I fixed the bug -- the problem was that I wasn't allocating the size of the array correctly

seanyoung (Tue, 28 Jul 2020 09:18:36 GMT):
@KiChjang perfect! I had started looking but couldn't figure it out

KiChjang (Tue, 28 Jul 2020 09:19:13 GMT):
so i did mention that it was pointer-to-structs instead of just structs, but when i was calculating the element size, i didn't factor this in

KiChjang (Tue, 28 Jul 2020 10:07:47 GMT):
@seanyoung alright, I'm moving on to pop, and I have to ask: what happens when you pop an empty array?

KiChjang (Tue, 28 Jul 2020 10:08:05 GMT):
perhaps a no-op, and return the element's default value?

seanyoung (Tue, 28 Jul 2020 10:52:34 GMT):
pop on an empty array should abort execution. This can be done with `runtime.assert_failure()`

KiChjang (Tue, 28 Jul 2020 19:31:02 GMT):
uh oh, i've encountered an LLVM quirk that i'm not sure how to solve...

KiChjang (Tue, 28 Jul 2020 19:31:19 GMT):
it looks like that i can't just compare dynamic values with constant values

KiChjang (Tue, 28 Jul 2020 19:31:19 GMT):
it looks like that i can't just compare dynamic values with constant values using `==`

KiChjang (Tue, 28 Jul 2020 19:32:02 GMT):
so for instance, i'm trying to check if the array has a length of `0`, and if so, `assert_failure` as above

KiChjang (Tue, 28 Jul 2020 19:32:37 GMT):
i can't just say `if len == self.context.i32_type().const_zero()`

KiChjang (Tue, 28 Jul 2020 19:32:58 GMT):
this would throw at runtime saying that the types are different

seanyoung (Tue, 28 Jul 2020 20:12:24 GMT):
In order to compare the length to 0 at runtime, you need to generate a compare instruction like so: ``` let array_empty = self.builder.build_int_compare( IntPredicate::EQ, len, self.context.i32_type().const_zero(), "array_empty", ); ``` Then, there should be a branch based to `array_empty`, for which you'll need two basic blocks. It should look like: https://github.com/hyperledger-labs/solang/blob/master/src/emit/mod.rs#L3812-L3833

sbalikondwar (Tue, 28 Jul 2020 20:20:02 GMT):
Hi there so I made changes and they are in the solang-server https://github.com/Hyperion101010/solang-vscode/tree/phase-2/solang-server

sbalikondwar (Tue, 28 Jul 2020 20:21:20 GMT):
there is one error of thread safety can you help there cause I am not able to understand the reason for that (some Send and async thing)

sbalikondwar (Tue, 28 Jul 2020 20:22:07 GMT):
Now if I compile it using cargo there is the thread safety error

sbalikondwar (Tue, 28 Jul 2020 20:22:57 GMT):
I tried compiling it in one single file server_eg which I updated and sent you the pic on sunday about the same which works fine.

sbalikondwar (Tue, 28 Jul 2020 20:23:24 GMT):
here https://github.com/Hyperion101010/solang-vscode/blob/phase-2/tower-lsp/examples/server_eg.rs

sbalikondwar (Tue, 28 Jul 2020 20:24:33 GMT):
Sorry there was a delay today got busy in some work and joined in late after dinner

sbalikondwar (Tue, 28 Jul 2020 20:26:01 GMT):
What I interests me is the same impl works if it is in one file (server_eg) and not when it is in one project (solang-server)

sbalikondwar (Tue, 28 Jul 2020 20:26:01 GMT):
What interests me is the same impl works if it is in one file (server_eg) and not when it is in one project (solang-server)

sbalikondwar (Tue, 28 Jul 2020 20:26:01 GMT):
What interests me is the same impl works if it is in one file (server_eg) and not when it is in one project (solang-server) which is in the project dir.

seanyoung (Tue, 28 Jul 2020 20:57:48 GMT):
So I think the error can be fixed by using Arc rather than Rc But I'm wondering if that is the right solution.

seanyoung (Tue, 28 Jul 2020 21:01:33 GMT):
I think what should happen here is to make Backend an empty stuct (like it was in tower-lsp), and create an instance of the `SolangDiagnostic` when it is needed in the `did_open` and `did_change` functions.

seanyoung (Tue, 28 Jul 2020 21:02:55 GMT):
This is also correct because the file_cache while retain copies of the file even when they change on disk, so a new file cache object should always be created. In future solang file_cache could be improved and reload changed files from disk but for now it is easier to create a new file cache for each request.

KiChjang (Tue, 28 Jul 2020 21:17:43 GMT):
huh... LLVM is still throwing runtime assertions when i tried to use `build_int_compare`

KiChjang (Tue, 28 Jul 2020 21:18:25 GMT):
it's the type mismatch between the array length and `self.context.i32_type().const_zero()`

KiChjang (Tue, 28 Jul 2020 21:18:35 GMT):
looks like const values are of a different type?

seanyoung (Tue, 28 Jul 2020 21:19:15 GMT):
hmm have you loaded the len or do you just have the result from build_gep()?

KiChjang (Tue, 28 Jul 2020 21:19:31 GMT):
i did build a load first after calling build_gep

seanyoung (Tue, 28 Jul 2020 21:19:49 GMT):
would you mind sharing the code so I can have a look please

KiChjang (Tue, 28 Jul 2020 21:19:58 GMT):
ok one sec

KiChjang (Tue, 28 Jul 2020 21:21:38 GMT):
@seanyoung here you go: https://github.com/KiChjang/solang/commit/2ee0f3ab838e59e0a0d0468685baa2c3d87a7b84#diff-87f147c2d21757d7c3161a722a305b7eR3156

seanyoung (Tue, 28 Jul 2020 21:31:54 GMT):
Hmm this is not obvious at first glance. So, I suspect that for some reason `array` is not a pointer to a vector, possible the instruction was not populated correctly. You can do: ``` println!("array:{}", array.print_to_string()); ``` on line 3156 to see what type it really is.

seanyoung (Tue, 28 Jul 2020 21:33:05 GMT):
or rather `array.get_type().into_pointer_type().print_to_string()`

KiChjang (Tue, 28 Jul 2020 22:40:33 GMT):
hmm... so it does say `array:"%struct.vector*"`

KiChjang (Tue, 28 Jul 2020 22:44:25 GMT):
I'm going to see what I get for `len` as well

KiChjang (Tue, 28 Jul 2020 23:01:23 GMT):
it also does say `len:"i32"`

KiChjang (Wed, 29 Jul 2020 00:25:16 GMT):
so the plot thickens, because when i try to `const_cast` len to a i32, LLVM also throws an error

sbalikondwar (Wed, 29 Jul 2020 08:38:26 GMT):
good morning

seanyoung (Wed, 29 Jul 2020 09:05:48 GMT):
good morning

sbalikondwar (Wed, 29 Jul 2020 09:09:36 GMT):
today we have meet as always at 5PM IST

sbalikondwar (Wed, 29 Jul 2020 09:12:35 GMT):
Meanwhile better for me to read more https://rust-lang.github.io/async-book/01_getting_started/02_why_async.html

sbalikondwar (Wed, 29 Jul 2020 09:20:28 GMT):
As we discussed in past meet about the diagnostic impl, this time I will be discussing code compilation as per our plan https://wiki.hyperledger.org/pages/viewpage.action?pageId=31202927

sbalikondwar (Wed, 29 Jul 2020 09:21:46 GMT):
I mean it will be very useful to get insight on code compilation by solang

sbalikondwar (Wed, 29 Jul 2020 11:42:38 GMT):
#[derive(Debug, Default)] struct DocumentState { text: String, } // mapping of file uri to its server document state type State = HashMap; pub struct Backend { language: Box, state: Mutex, }

sbalikondwar (Wed, 29 Jul 2020 11:43:40 GMT):
https://github.com/wayfair-tremor/tremor-language-server/blob/master/src/backend.rs#L27

sbalikondwar (Wed, 29 Jul 2020 12:04:31 GMT):
https://wiki.hyperledger.org/pages/viewpage.action?pageId=31202927

sbalikondwar (Thu, 30 Jul 2020 15:34:14 GMT):
I have some work today so will be working late

sbalikondwar (Thu, 30 Jul 2020 15:34:35 GMT):
Good evening

KiChjang (Fri, 31 Jul 2020 06:33:12 GMT):
ok, i can't figure out what in the world is wrong with this `len`

KiChjang (Fri, 31 Jul 2020 06:33:51 GMT):
i tried a couple of things: first, instead of comparing with `self.context.i32_type().const_zero()`, i did `len.get_type().const_zero()`

KiChjang (Fri, 31 Jul 2020 06:33:53 GMT):
that failed

KiChjang (Fri, 31 Jul 2020 06:34:16 GMT):
then i tried `len.const_cast(self.context.i32_type(), false0`

KiChjang (Fri, 31 Jul 2020 06:34:18 GMT):
that failed too

KiChjang (Fri, 31 Jul 2020 06:34:49 GMT):
i tried explicitly casting the element pointer to `i32_type().ptr_type(AddressSpace::Generic)` too, but that still didn't work

KiChjang (Fri, 31 Jul 2020 06:34:49 GMT):
i tried explicitly casting the element pointer to `i32_type().ptr_type(AddressSpace::Generic)` before loading it, but that still didn't work

KiChjang (Fri, 31 Jul 2020 06:35:37 GMT):
i have absolutely no idea why this is behaving so strangely

KiChjang (Fri, 31 Jul 2020 06:35:43 GMT):
did we hit a UB somewhere?

KiChjang (Fri, 31 Jul 2020 09:43:22 GMT):
what the hell, even printing `len.get_type() == self.context.i32_type()` gives me true

KiChjang (Fri, 31 Jul 2020 09:47:38 GMT):
how come it's all wrong once it crosses the C boundary?!

sbalikondwar (Fri, 31 Jul 2020 13:41:13 GMT):
good evening @seanyoung

sbalikondwar (Fri, 31 Jul 2020 13:42:05 GMT):
so i made the suggested changes, i have the solang-server compiled and it runs but there are some bugs (which is expected) I am working to fix those and range thing

sbalikondwar (Fri, 31 Jul 2020 13:42:15 GMT):
I updated the plan for same

sbalikondwar (Fri, 31 Jul 2020 13:42:15 GMT):
I updated the project plan for same

seanyoung (Fri, 31 Jul 2020 14:10:29 GMT):
good evening @sbalikondwar

sbalikondwar (Fri, 31 Jul 2020 14:31:11 GMT):
will be working this weekend as well

sbalikondwar (Fri, 31 Jul 2020 14:31:36 GMT):
but i hope to plan one point out of the article

seanyoung (Fri, 31 Jul 2020 20:34:26 GMT):
@KiChjang on line https://github.com/KiChjang/solang/blob/array-push-pop/src/emit/mod.rs#L3234 you are missing a cast. Now, you are loading an i8. Since in the test you have an `int256` array, so the compare fails.

seanyoung (Fri, 31 Jul 2020 20:34:51 GMT):
So the pointer needs to be cast to the pointer of the element ty.

KiChjang (Sat, 01 Aug 2020 04:09:58 GMT):
oh, hmm, i was thinking if i was looking at the wrong place... will try and see if it fixes the issue, thanks!

KiChjang (Sat, 01 Aug 2020 05:57:26 GMT):
@seanyoung that did the trick!

KiChjang (Sat, 01 Aug 2020 05:57:53 GMT):
i was definitely stuck on an xy problem, thinking that a type mismatch must have resulted from an equality comparison

seanyoung (Sat, 01 Aug 2020 15:31:02 GMT):
@KiChjang thanks for contribution! looks good

seanyoung (Sat, 01 Aug 2020 15:31:02 GMT):
@KiChjang thanks for your contribution! looks good

KiChjang (Sat, 01 Aug 2020 22:25:50 GMT):
@seanyoung thanks for accepting me for the bounty! Sorry it took longer than usual... I had a really hard time looking for the proper motivation in the middle of this year. If you have any other bounties that you are currently hosting, please don't hesitate to let me know, it's been really enjoyable for me to work on solang!

sbalikondwar (Sun, 02 Aug 2020 20:41:03 GMT):
Worked on range thing today for some time

sbalikondwar (Sun, 02 Aug 2020 20:41:54 GMT):
Will catch up tomorrow, logging off for now

seanyoung (Sun, 02 Aug 2020 21:00:18 GMT):
@KiChjang I'm sure there will be more bounties, I'll let you know if when they are made available!

seanyoung (Sun, 02 Aug 2020 21:17:33 GMT):
@sbalikondwar look forward to hearing how you got on

sbalikondwar (Mon, 03 Aug 2020 11:07:02 GMT):
good evening

sbalikondwar (Mon, 03 Aug 2020 11:08:44 GMT):
@seanyoung I am a bit confused on here https://github.com/hyperledger-labs/solang/blob/master/src/parser/pt.rs#L5

sbalikondwar (Mon, 03 Aug 2020 11:09:15 GMT):
I tried to use this for range, but later came to know this pointer for something

sbalikondwar (Mon, 03 Aug 2020 11:09:15 GMT):
I tried to use this for range, but later came to know this is pointer for something

sbalikondwar (Mon, 03 Aug 2020 11:09:35 GMT):
Do you have any info on Loc of parser?

sbalikondwar (Mon, 03 Aug 2020 11:09:46 GMT):
i mean what it is used for

seanyoung (Mon, 03 Aug 2020 11:23:55 GMT):
The loc is a struct with three usize. The first is the filename; this is an index into `ns.files[file_no`. The second is the start offset, the last usize is the end offset.

seanyoung (Mon, 03 Aug 2020 11:23:55 GMT):
The loc is a struct with three usize. The first is the filename; this is an index into `ns.files[file_no]`. The second is the start offset, the last usize is the end offset.

seanyoung (Mon, 03 Aug 2020 11:24:47 GMT):
so if you have a Loc name `loc` then you can get the filename with `ns.files[loc.0]`

sbalikondwar (Mon, 03 Aug 2020 11:27:29 GMT):
offset for file content?

seanyoung (Mon, 03 Aug 2020 11:28:54 GMT):
yes, byte offset in the file

sbalikondwar (Mon, 03 Aug 2020 13:49:39 GMT):
Going for the short checkin call scheduled for today

sbalikondwar (Mon, 03 Aug 2020 14:00:43 GMT):
@seanyoung

sbalikondwar (Mon, 03 Aug 2020 14:00:53 GMT):
was it mentor as well?

seanyoung (Mon, 03 Aug 2020 14:00:58 GMT):
Yep, just starting

seanyoung (Mon, 03 Aug 2020 14:01:14 GMT):
Has your been already?

sbalikondwar (Mon, 03 Aug 2020 14:01:25 GMT):
ok, i am also there :sweat_smile:

sbalikondwar (Mon, 03 Aug 2020 14:01:30 GMT):
we are in same meet

seanyoung (Mon, 03 Aug 2020 14:01:42 GMT):
ah yes I see you there :)

sbalikondwar (Mon, 03 Aug 2020 14:01:49 GMT):
"Shivam Balikondwar"

seanyoung (Mon, 03 Aug 2020 14:01:58 GMT):
of course

sbalikondwar (Mon, 03 Aug 2020 14:02:39 GMT):
i was hoping if I will be presenting the points for our project

sbalikondwar (Mon, 03 Aug 2020 14:02:50 GMT):
or would you like to add something?

seanyoung (Mon, 03 Aug 2020 14:04:01 GMT):
I haven't prepared anything.

sbalikondwar (Mon, 03 Aug 2020 14:04:03 GMT):
for now min said some points like, project progress, challenge encountered(perhaps you can add some points) , learned from open source, next plan

sbalikondwar (Mon, 03 Aug 2020 14:04:17 GMT):
glad i have some points listed

seanyoung (Mon, 03 Aug 2020 14:04:23 GMT):
yes, thank you!

seanyoung (Mon, 03 Aug 2020 14:11:38 GMT):
:thumbsup:

sbalikondwar (Mon, 03 Aug 2020 14:12:39 GMT):
i hoped to speak some more but forgot some point that should be enough

sbalikondwar (Mon, 03 Aug 2020 14:12:39 GMT):
i hoped to speak some more but forgot some point, that should be enough

seanyoung (Mon, 03 Aug 2020 14:13:23 GMT):
I think that covered the important points

sbalikondwar (Mon, 03 Aug 2020 14:18:25 GMT):
2 weeks thing seems a unique approach!

seanyoung (Mon, 03 Aug 2020 14:18:49 GMT):
Yes, but so far it has worked for us, right?

sbalikondwar (Mon, 03 Aug 2020 14:18:55 GMT):
yeah

sbalikondwar (Mon, 03 Aug 2020 14:19:02 GMT):
well it works

sbalikondwar (Mon, 03 Aug 2020 14:21:26 GMT):
let's keep it to wednesday ?

sbalikondwar (Mon, 03 Aug 2020 14:21:38 GMT):
the usual schedule rather than today

seanyoung (Mon, 03 Aug 2020 14:21:55 GMT):
Wednesday is good for me.

sbalikondwar (Mon, 03 Aug 2020 14:35:54 GMT):
that suggestion is very helpful

seanyoung (Mon, 03 Aug 2020 14:55:39 GMT):
So since you've commited to solang-vscode you can vote in the elections

sbalikondwar (Mon, 03 Aug 2020 14:56:54 GMT):
great :thumbsup:

sbalikondwar (Mon, 03 Aug 2020 14:57:57 GMT):
https://wiki.hyperledger.org/display/TSC/TSC+Election+2020-2021

seanyoung (Mon, 03 Aug 2020 14:58:11 GMT):
exactly

sbalikondwar (Mon, 03 Aug 2020 14:59:10 GMT):
it was good catching up with others

seanyoung (Mon, 03 Aug 2020 15:11:03 GMT):
yes, I agree

sbalikondwar (Mon, 03 Aug 2020 15:29:03 GMT):
@seanyoung so i have file contents as string but any idea how will i map it to the correct line number?

sbalikondwar (Mon, 03 Aug 2020 15:30:37 GMT):
yeah so i figured it out

sbalikondwar (Mon, 03 Aug 2020 15:30:53 GMT):
first lets say we have two offsets l and r

sbalikondwar (Mon, 03 Aug 2020 15:31:03 GMT):
and we have a string of file named f

sbalikondwar (Mon, 03 Aug 2020 15:33:12 GMT):
Now first i will get file as a string and create its copy as array of prefix sum of byte quantities per line which is already in file cache

sbalikondwar (Mon, 03 Aug 2020 15:33:46 GMT):
then we can run search function to get specific line as per offset

sbalikondwar (Mon, 03 Aug 2020 15:37:01 GMT):
sorry to bother you already discussed that

sbalikondwar (Mon, 03 Aug 2020 15:54:55 GMT):
there are two things needed for me to use this https://github.com/hyperledger-labs/solang/blob/master/src/sema/diagnostics.rs#L242

sbalikondwar (Mon, 03 Aug 2020 15:55:36 GMT):
the struct has to private and there is a spelling mistake change FilePostitions to FilePositions

sbalikondwar (Mon, 03 Aug 2020 15:55:36 GMT):
the struct has to be public and there is a spelling mistake change FilePostitions to FilePositions

sbalikondwar (Mon, 03 Aug 2020 15:56:00 GMT):
in the meantime i can work with copying the impl

sbalikondwar (Mon, 03 Aug 2020 15:56:08 GMT):
and using it on my side

sbalikondwar (Mon, 03 Aug 2020 16:03:07 GMT):
going for dinner will be back in sometime

seanyoung (Mon, 03 Aug 2020 16:04:37 GMT):
Ok I'll make those changes. Enjoy dinner!

seanyoung (Mon, 03 Aug 2020 17:36:31 GMT):
https://github.com/hyperledger-labs/solang/pull/246

sbalikondwar (Tue, 04 Aug 2020 09:10:41 GMT):
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fd8f4cacc0fea4f6abff3e30ffcb4d8d

sbalikondwar (Tue, 04 Aug 2020 09:22:06 GMT):
i tried to model it before implementing

seanyoung (Tue, 04 Aug 2020 10:08:39 GMT):
That's interesting!

seanyoung (Tue, 04 Aug 2020 10:17:11 GMT):
Hmm I get arithmetic overflow on calculating line/column of offset 0

seanyoung (Tue, 04 Aug 2020 10:17:12 GMT):
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=ebdae43d0f00609dd972d34b2b864eb0

seanyoung (Tue, 04 Aug 2020 10:18:29 GMT):
I think it needs a slightly modified binary search because you're not looking for a match, you're looking for a "closest to"

sbalikondwar (Tue, 04 Aug 2020 12:14:04 GMT):
i was away for lunch

sbalikondwar (Tue, 04 Aug 2020 12:14:19 GMT):
yes so i have also tried running it in vscode

sbalikondwar (Tue, 04 Aug 2020 12:14:24 GMT):
same problem

sbalikondwar (Tue, 04 Aug 2020 12:14:52 GMT):
offset 0 can be the key , will try changing

sbalikondwar (Tue, 04 Aug 2020 12:17:39 GMT):
yeah so if the input val lies in 0 index i won't compute rather than just return 0

sbalikondwar (Tue, 04 Aug 2020 12:17:54 GMT):
like here in this case for val < 22

sbalikondwar (Tue, 04 Aug 2020 12:24:23 GMT):
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=bead2bdef962f2e1338b16176cef145e

sbalikondwar (Tue, 04 Aug 2020 12:27:51 GMT):
wow

sbalikondwar (Tue, 04 Aug 2020 12:28:07 GMT):

Screenshot from 2020-08-04 17-57-45.png

seanyoung (Tue, 04 Aug 2020 12:30:07 GMT):
It does not return the correct line for the last offset

seanyoung (Tue, 04 Aug 2020 12:30:12 GMT):
should be 5, I think

sbalikondwar (Tue, 04 Aug 2020 12:30:34 GMT):
yes thats the catch

sbalikondwar (Tue, 04 Aug 2020 12:31:06 GMT):
no its correct

sbalikondwar (Tue, 04 Aug 2020 12:31:06 GMT):
wait let me check

sbalikondwar (Tue, 04 Aug 2020 12:46:21 GMT):
@seanyoung are you talking about the pic or https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=5731613ffdd5d9ff25ad58ca3def4bae

sbalikondwar (Tue, 04 Aug 2020 12:46:33 GMT):
I think it is correct

sbalikondwar (Tue, 04 Aug 2020 12:46:58 GMT):
cause according to the code on playground, the last index is '4' which is the correct one

sbalikondwar (Tue, 04 Aug 2020 12:47:35 GMT):
You need to look carefully in the vscode the last line highlighted is line 23

sbalikondwar (Tue, 04 Aug 2020 12:47:35 GMT):
You need to look carefully in the vscode pic the last line highlighted is line 20

sbalikondwar (Tue, 04 Aug 2020 12:47:35 GMT):
You need to look carefully in the vscode pic the last line highlighted is line 20, which is indeed the last one

sbalikondwar (Tue, 04 Aug 2020 12:49:51 GMT):
the catch that i found was, if in c == '\n' there can be one case when there is no \n atlast in the file

sbalikondwar (Tue, 04 Aug 2020 12:49:51 GMT):
the catch that i found was, if in c == '\n' there can be one case when there is no \n at end in the file

sbalikondwar (Tue, 04 Aug 2020 12:50:09 GMT):
at that time the vector never fills in the last index

sbalikondwar (Tue, 04 Aug 2020 13:11:00 GMT):
fixed that case as well https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d8ec66810036601dc5354fbc18c988af

sbalikondwar (Tue, 04 Aug 2020 13:11:00 GMT):
fixed last line not '\n' case as well https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d8ec66810036601dc5354fbc18c988af

sbalikondwar (Tue, 04 Aug 2020 14:53:27 GMT):
@seanyoung https://github.com/Hyperion101010/solang-vscode/tree/phase-2

sbalikondwar (Tue, 04 Aug 2020 14:53:44 GMT):
uploaded some changes and it compiles along with range

sbalikondwar (Tue, 04 Aug 2020 14:53:54 GMT):
can you do a sample run

sbalikondwar (Tue, 04 Aug 2020 14:54:09 GMT):
on your local pc and let me know of any problems

seanyoung (Tue, 04 Aug 2020 16:31:26 GMT):
@sbalikondwar looking forward to it

sbalikondwar (Tue, 04 Aug 2020 17:20:59 GMT):
Wait, can do check out the patch that I uploaded

sbalikondwar (Tue, 04 Aug 2020 17:20:59 GMT):
Wait, can you do check out the patch that I uploaded

sbalikondwar (Tue, 04 Aug 2020 17:20:59 GMT):
Wait, can you check out the patch that I uploaded

sbalikondwar (Tue, 04 Aug 2020 17:22:04 GMT):
Cause it looks decent from my side but might not be exactly as expected so I want you to do a sample first hand experience to confirm it is as expected

sbalikondwar (Wed, 05 Aug 2020 08:57:01 GMT):
good morning/afternoon

seanyoung (Wed, 05 Aug 2020 08:57:12 GMT):
Good afternoon

seanyoung (Wed, 05 Aug 2020 08:57:45 GMT):
Sorry I have been busy, I haven't had a chance to look at your changes yet

sbalikondwar (Wed, 05 Aug 2020 08:57:59 GMT):
no problem, whenever you are free

sbalikondwar (Wed, 05 Aug 2020 08:58:18 GMT):
you are available for today's meet though?

seanyoung (Wed, 05 Aug 2020 08:58:30 GMT):
Yes, I am.

sbalikondwar (Wed, 05 Aug 2020 08:58:38 GMT):
great

seanyoung (Wed, 05 Aug 2020 09:05:43 GMT):
I've just run it and it's great to see the compiler diagnostics coming through!

sbalikondwar (Wed, 05 Aug 2020 09:07:13 GMT):
:thumbsup: now i am working on ci actions and tests

sbalikondwar (Wed, 05 Aug 2020 09:08:00 GMT):
the diagnostics might take 2-3 to process when editing files

sbalikondwar (Wed, 05 Aug 2020 09:08:00 GMT):
the diagnostics might take 2-3 sec to process when editing files

seanyoung (Wed, 05 Aug 2020 09:09:36 GMT):
The diagnostic range seems off somehow. Also if I select text I get an error (highlight not implemented).

sbalikondwar (Wed, 05 Aug 2020 09:09:58 GMT):
let's discuss them in meet in sometime

seanyoung (Wed, 05 Aug 2020 09:12:19 GMT):
The diagnostic "found contract 'foo'" is not really helpful

seanyoung (Wed, 05 Aug 2020 09:12:36 GMT):
Anyway looks good

sbalikondwar (Wed, 05 Aug 2020 11:40:04 GMT):

Screenshot from 2020-08-05 17-09-45.png

sbalikondwar (Wed, 05 Aug 2020 11:42:33 GMT):

Screenshot from 2020-08-05 17-12-17.png

seanyoung (Wed, 05 Aug 2020 11:43:39 GMT):

Screenshot from 2020-08-05 12-42-34.png

seanyoung (Wed, 05 Aug 2020 11:46:25 GMT):
``` $ solang x.sol x.sol:3:1-5: error: unrecognised token `asda', expected "abstract", "contract", "enum", "import", "interface", "library", "pragma", "struct", DocComment x.sol: error: no contracts found ```

seanyoung (Wed, 05 Aug 2020 11:49:50 GMT):

Screenshot from 2020-08-05 12-49-31.png

seanyoung (Wed, 05 Aug 2020 11:51:08 GMT):
``` $ solang barf.sol barf.sol:4:27-34: error: function redeclared `private' barf.sol:4:20-26: note: location of previous declaration of `public' barf.sol: error: no contracts found ```

sbalikondwar (Wed, 05 Aug 2020 12:13:24 GMT):
tea time :coffee: , will join in sometime

sbalikondwar (Thu, 06 Aug 2020 17:25:49 GMT):
Good evening

seanyoung (Thu, 06 Aug 2020 18:05:41 GMT):
good evening

sbalikondwar (Fri, 07 Aug 2020 13:24:05 GMT):
good evening

sbalikondwar (Fri, 07 Aug 2020 13:24:13 GMT):
i identified the problem

sbalikondwar (Fri, 07 Aug 2020 13:25:34 GMT):
the value of Loc.1 AND Loc.2 recieved has to be processed for col which i didn't impl in hurry

sbalikondwar (Fri, 07 Aug 2020 13:40:37 GMT):
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=9c2f33e7e256906a160263af25f6dfc7

sbalikondwar (Fri, 07 Aug 2020 13:48:17 GMT):
ok looks like fixed

sbalikondwar (Fri, 07 Aug 2020 15:02:50 GMT):
by the way how is the weather there

seanyoung (Fri, 07 Aug 2020 15:11:44 GMT):
good evening That column calculation looks good!

seanyoung (Fri, 07 Aug 2020 15:12:38 GMT):
It's 36 C here, which is unusual for this climate. Very few houses have air conditioning here. So it's far too hot!

seanyoung (Fri, 07 Aug 2020 15:12:41 GMT):
How about you?

seanyoung (Fri, 07 Aug 2020 15:18:04 GMT):
I've registered ``solang.io``

seanyoung (Fri, 07 Aug 2020 15:18:04 GMT):
I've registered `solang.io`

seanyoung (Fri, 07 Aug 2020 15:20:26 GMT):
I've only written a tiny page so far https://solang.io/

sbalikondwar (Fri, 07 Aug 2020 15:24:02 GMT):
what have you used?

sbalikondwar (Fri, 07 Aug 2020 15:24:08 GMT):
i mean framework

sbalikondwar (Fri, 07 Aug 2020 15:24:54 GMT):
still looks good, i bet we could use hugo

sbalikondwar (Fri, 07 Aug 2020 15:24:54 GMT):
looks good, i bet we could use hugo

sbalikondwar (Fri, 07 Aug 2020 15:24:54 GMT):
looks good, i bet we could use hugo (just being over ambitious)

sbalikondwar (Fri, 07 Aug 2020 15:26:13 GMT):
well it is different anyways, good to have every detail at one point :slight_smile:

sbalikondwar (Fri, 07 Aug 2020 15:26:13 GMT):
well it is different anyways, good to have every detail on one page :slight_smile:

sbalikondwar (Fri, 07 Aug 2020 15:26:13 GMT):
good to have every detail on one page :slight_smile:

seanyoung (Fri, 07 Aug 2020 15:29:58 GMT):
I used vi

sbalikondwar (Fri, 07 Aug 2020 15:30:02 GMT):
Its 36C here as well

sbalikondwar (Fri, 07 Aug 2020 15:30:34 GMT):
but it is more like pleasent temp, as we are used to too hot temp

seanyoung (Fri, 07 Aug 2020 15:31:08 GMT):
We're not used to it here. The street is pretty empty!

sbalikondwar (Fri, 07 Aug 2020 15:31:21 GMT):
its raining as well

sbalikondwar (Fri, 07 Aug 2020 15:32:02 GMT):
I plan to work on test this weekend as the coloumns are now taken care of

sbalikondwar (Fri, 07 Aug 2020 15:32:02 GMT):
I plan to work on test this weekend as the columns are now taken care of

sbalikondwar (Fri, 07 Aug 2020 15:34:14 GMT):
I am also interested to read a book

sbalikondwar (Fri, 07 Aug 2020 15:34:14 GMT):
I am also planning to read a book

seanyoung (Fri, 07 Aug 2020 15:34:51 GMT):
What are you planning to read?

sbalikondwar (Fri, 07 Aug 2020 15:35:40 GMT):
I am more inclined to auto biographies, haven't decided yet

sbalikondwar (Fri, 07 Aug 2020 15:36:41 GMT):
I have this one https://charlesduhigg.com/the-power-of-habit/ so can try

seanyoung (Fri, 07 Aug 2020 15:37:11 GMT):
interesting

sbalikondwar (Fri, 07 Aug 2020 15:37:25 GMT):
what about you do you read

seanyoung (Fri, 07 Aug 2020 15:41:25 GMT):
The last year or so I have only read books on compilers. I've just finished reading https://www.amazon.co.uk/Parsing-Techniques-Practical-Monographs-Computer/dp/1441919015/ and before that I read latest edition of https://www.amazon.co.uk/Compilers-Pearson-International-Principles-Techniques/dp/1292024348/

seanyoung (Fri, 07 Aug 2020 15:42:55 GMT):
Other than that I like Tolstoy and other russian authors from that time.

sbalikondwar (Fri, 07 Aug 2020 15:43:46 GMT):
Oh, i remember reading tolstoy back in high school

sbalikondwar (Fri, 07 Aug 2020 15:44:30 GMT):
not the book but just some snippets out of his works

sbalikondwar (Fri, 07 Aug 2020 15:45:19 GMT):
anyways got dinner, will be away for sometime and I hope you are also aval in weekend

sbalikondwar (Fri, 07 Aug 2020 15:45:19 GMT):
anyways got dinner, will be away for sometime and I hope you are aval in weekend

sbalikondwar (Fri, 07 Aug 2020 15:46:07 GMT):
see you night

seanyoung (Fri, 07 Aug 2020 15:46:43 GMT):
good evening/night!

sbalikondwar (Sun, 09 Aug 2020 13:47:47 GMT):
good afternoon

seanyoung (Sun, 09 Aug 2020 17:42:43 GMT):
good afternoon

seanyoung (Sun, 09 Aug 2020 17:42:52 GMT):
I guess it's already very late for you

sbalikondwar (Sun, 09 Aug 2020 17:48:51 GMT):
Kind of late but I work on this time usually

sbalikondwar (Sun, 09 Aug 2020 17:49:01 GMT):
Anyways it's Sunday so will take some time off

sbalikondwar (Sun, 09 Aug 2020 17:49:14 GMT):
I worked on test for sometime

sbalikondwar (Sun, 09 Aug 2020 17:52:39 GMT):
Ok , see you tomorrow @seanyoung good night

seanyoung (Sun, 09 Aug 2020 17:57:47 GMT):
see you tomorrow ! good night

sbalikondwar (Mon, 10 Aug 2020 08:00:45 GMT):
good evening/morning

sbalikondwar (Mon, 10 Aug 2020 08:01:22 GMT):
I have made some progress on the diagnos tests, till now i am able to get the diagnostic JSONRPC in tests as well

sbalikondwar (Mon, 10 Aug 2020 08:01:47 GMT):
so now will just have to make some sample test entries and match them up with expected

sbalikondwar (Mon, 10 Aug 2020 08:03:01 GMT):

Screenshot from 2020-08-10 13-32-37.png

seanyoung (Mon, 10 Aug 2020 08:16:37 GMT):
Hello @sbalikondwar That's good

sbalikondwar (Mon, 10 Aug 2020 08:33:35 GMT):
how was the weekend, For me i got some useful points from the book

seanyoung (Mon, 10 Aug 2020 09:00:57 GMT):
I had a good weekend, I had to work on fund-raising. Very time consuming.

sbalikondwar (Mon, 10 Aug 2020 09:03:55 GMT):
interesting, funds for an NGO?

sbalikondwar (Mon, 10 Aug 2020 09:03:58 GMT):
https://lifehacker.com/top-10-ways-to-break-bad-habits-1694247761

sbalikondwar (Mon, 10 Aug 2020 09:04:10 GMT):
something worth reading

sbalikondwar (Mon, 10 Aug 2020 09:04:40 GMT):
@seanyoung how many test you want me to implement

sbalikondwar (Mon, 10 Aug 2020 09:05:08 GMT):
i am thinking of 3, one of type information when the code is correct

sbalikondwar (Mon, 10 Aug 2020 09:05:28 GMT):
one for row, col position when code is incorrect

sbalikondwar (Mon, 10 Aug 2020 09:05:36 GMT):
one for private public error

seanyoung (Mon, 10 Aug 2020 09:05:38 GMT):
I think there should be an error, a warning and informational. Maybe a couple to test various file offsets

seanyoung (Mon, 10 Aug 2020 09:05:48 GMT):
exactly that :)

sbalikondwar (Mon, 10 Aug 2020 09:06:25 GMT):
yeah, I am confident we can append the test list later for more

seanyoung (Mon, 10 Aug 2020 09:06:27 GMT):
With fundraising I mean grant applications.

sbalikondwar (Mon, 10 Aug 2020 09:07:05 GMT):
Ah, ok wasm is gaining popularity nowadays?

sbalikondwar (Mon, 10 Aug 2020 09:07:19 GMT):
i mean do we have any major firm/project on that

seanyoung (Mon, 10 Aug 2020 09:07:53 GMT):
It seems all the chains are using wasm now, or still using evm if they have smart contracts.

sbalikondwar (Mon, 10 Aug 2020 12:10:28 GMT):
@seanyoung any ideas on warning test case, I mean what wrong should i have in code to get warning

sbalikondwar (Mon, 10 Aug 2020 12:10:28 GMT):
@seanyoung any ideas for warning test case, I mean what wrong should i have in code to get warning

sbalikondwar (Mon, 10 Aug 2020 12:10:47 GMT):
i thought of returning values in a constructor

sbalikondwar (Mon, 10 Aug 2020 12:10:55 GMT):
but its a error and not warning

seanyoung (Mon, 10 Aug 2020 12:15:08 GMT):
you can do "pragma foo bar;"

seanyoung (Mon, 10 Aug 2020 12:15:31 GMT):
or declare function which does not modify contract state, and not declare it pure ``` contract a { ```

seanyoung (Mon, 10 Aug 2020 12:15:31 GMT):
or declare function which does not modify contract state, and not declare it pure ``` contract a { function foo() public returns (int) { return 1; } } ```

sbalikondwar (Mon, 10 Aug 2020 12:16:37 GMT):
pragma works, also the second one

sbalikondwar (Mon, 10 Aug 2020 12:16:40 GMT):
thanks

sbalikondwar (Mon, 10 Aug 2020 13:02:31 GMT):
tea time :coffee: back in sometime

sbalikondwar (Mon, 10 Aug 2020 13:02:45 GMT):
wrote the tests, will test and confirm them

sbalikondwar (Tue, 11 Aug 2020 06:41:48 GMT):
ok so have the tests running as well

sbalikondwar (Tue, 11 Aug 2020 06:42:04 GMT):

Screenshot from 2020-08-11 12-11-29.png

seanyoung (Tue, 11 Aug 2020 09:16:25 GMT):
Fantastic!

sbalikondwar (Tue, 11 Aug 2020 09:17:33 GMT):
good afternoon/morning

sbalikondwar (Tue, 11 Aug 2020 09:17:53 GMT):
so now i am taking care of ci actions and then will be good to PR

seanyoung (Tue, 11 Aug 2020 09:18:08 GMT):
I look forward to it

sbalikondwar (Tue, 11 Aug 2020 09:18:42 GMT):
i am nowadays waking up early, so getting more time to work :slight_smile:

seanyoung (Tue, 11 Aug 2020 09:23:16 GMT):
:) If I get up early, I am more productive. It's difficult to get into that routine though.

sbalikondwar (Tue, 11 Aug 2020 13:04:06 GMT):
https://github.com/Hyperion101010/solang-vscode/runs/970694234?check_suite_focus=true

sbalikondwar (Tue, 11 Aug 2020 13:04:32 GMT):
strange timeout errors occur on ci but when i run same on local pc as npm test

sbalikondwar (Tue, 11 Aug 2020 13:04:45 GMT):
all tests pass successfully

sbalikondwar (Tue, 11 Aug 2020 13:15:35 GMT):
ok looks like I will have to add some sleep therre

sbalikondwar (Tue, 11 Aug 2020 13:42:07 GMT):
anyways i have updated it https://github.com/Hyperion101010/solang-vscode/tree/phase-2

seanyoung (Tue, 11 Aug 2020 13:45:11 GMT):
perfect

seanyoung (Tue, 11 Aug 2020 13:45:19 GMT):
I'll have a look soon

sbalikondwar (Tue, 11 Aug 2020 13:48:33 GMT):
Thanks

sbalikondwar (Tue, 11 Aug 2020 15:16:49 GMT):
now I will have to add some docs dir as documentation for Diagnostics

sbalikondwar (Tue, 11 Aug 2020 15:17:02 GMT):
i hope it will as markdown file on github

sbalikondwar (Tue, 11 Aug 2020 15:17:02 GMT):
i hope it will be as markdown file on github, explaining how diagnostics work and a sample example

sbalikondwar (Tue, 11 Aug 2020 15:17:02 GMT):
i hope it will be as markdown file on github, explaining how diagnostics work and a sample example (i mean a gif)

sbalikondwar (Tue, 11 Aug 2020 17:57:23 GMT):
logging off for today @seanyoung , i hope to finsh up the doc tomorrow

sbalikondwar (Tue, 11 Aug 2020 17:57:38 GMT):
good night/evening

seanyoung (Tue, 11 Aug 2020 17:57:51 GMT):
good night

sbalikondwar (Wed, 12 Aug 2020 10:41:46 GMT):
good morning/evening

sbalikondwar (Wed, 12 Aug 2020 10:41:50 GMT):
@seanyoung

sbalikondwar (Wed, 12 Aug 2020 10:42:01 GMT):
we got meet today in nearly an hour

sbalikondwar (Wed, 12 Aug 2020 10:42:21 GMT):
I have wrote a sample doc to help the devs read on the diagnostics https://pastebin.com/kKkXrhFs

sbalikondwar (Wed, 12 Aug 2020 10:42:41 GMT):
let me know if you require some changes.

sbalikondwar (Wed, 12 Aug 2020 11:10:42 GMT):
https://github.com/Hyperion101010/solang-vscode/blob/phase-2/docs/diagnostics.md

sbalikondwar (Wed, 12 Aug 2020 11:43:13 GMT):
https://github.com/Hyperion101010/solang-vscode/runs/975536413

sbalikondwar (Wed, 12 Aug 2020 11:49:40 GMT):
https://github.com/Hyperion101010/solang-vscode/runs/975536512?check_suite_focus=true

seanyoung (Wed, 12 Aug 2020 11:50:53 GMT):
`cargo clippy`

seanyoung (Wed, 12 Aug 2020 11:51:45 GMT):
``` warning: this import is redundant --> src/main.rs:3:1 | 3 | use env_logger; | ^^^^^^^^^^^^^^^ help: remove it entirely | = note: `#[warn(clippy::single_component_path_imports)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports ```

sbalikondwar (Wed, 12 Aug 2020 15:49:17 GMT):
fixed the clippy problems

sbalikondwar (Wed, 12 Aug 2020 15:52:30 GMT):
i tried testing the first issue which was confirming if the diagnostics message change

sbalikondwar (Wed, 12 Aug 2020 15:52:35 GMT):
and they do change

sbalikondwar (Wed, 12 Aug 2020 15:52:41 GMT):
wait i will send gif

sbalikondwar (Wed, 12 Aug 2020 15:55:49 GMT):

testingclear.mp4

sbalikondwar (Wed, 12 Aug 2020 15:58:00 GMT):
let me know what you think

sbalikondwar (Wed, 12 Aug 2020 15:58:11 GMT):
i will log off for today

sbalikondwar (Wed, 12 Aug 2020 15:58:24 GMT):
see you, good evening/night

sbalikondwar (Wed, 12 Aug 2020 16:01:37 GMT):
it takes considerable time to recalculate so will have to look into that

sbalikondwar (Wed, 12 Aug 2020 16:10:40 GMT):
I understood the problem

sbalikondwar (Wed, 12 Aug 2020 16:11:31 GMT):
Sometime the file can appear as saved but in background the server might be running past activity (different state of same file)

sbalikondwar (Wed, 12 Aug 2020 16:11:49 GMT):
So at that such issue can occur

sbalikondwar (Wed, 12 Aug 2020 16:11:49 GMT):
So at that time such issue can occur

sbalikondwar (Thu, 13 Aug 2020 08:23:52 GMT):
good morning

sbalikondwar (Thu, 13 Aug 2020 08:24:03 GMT):
yeah so i looked into it

sbalikondwar (Thu, 13 Aug 2020 08:24:36 GMT):
i forgot to add impl for onsave action which resulted in the past diagnostic messages not the current one

sbalikondwar (Thu, 13 Aug 2020 08:24:40 GMT):
now its changed

sbalikondwar (Thu, 13 Aug 2020 08:25:02 GMT):
and whenever you make changes and save them it will show proper message

sbalikondwar (Thu, 13 Aug 2020 08:26:48 GMT):
it will also show diagnostic messages on changes in file without save but can sometimes be non-responsive which is logical cause lets consider

sbalikondwar (Thu, 13 Aug 2020 08:27:26 GMT):
i open a file, make some changes but forgot to save them (at this case the server will not know the current state and will compute the old file state)

sbalikondwar (Thu, 13 Aug 2020 08:28:19 GMT):
but after making changes if i save it or wait for few seconds then the diagnostics will be calculated correctly cause now the file state is changed and the server has the new file state

sbalikondwar (Thu, 13 Aug 2020 08:29:59 GMT):
now it is working without the clutters/lags as experienced before

sbalikondwar (Thu, 13 Aug 2020 09:09:05 GMT):
https://github.com/hyperledger-labs/solang-vscode/pull/7

seanyoung (Thu, 13 Aug 2020 09:43:11 GMT):
It looks great now! The PR can't be merged because of merge conflicts, as you can see on the pull request. Also I have some minor comments on the code, nothing major.

sbalikondwar (Thu, 13 Aug 2020 10:20:46 GMT):
the tower-lsp dir is removed

sbalikondwar (Thu, 13 Aug 2020 10:22:35 GMT):
the thing with keeping line vector reusable

sbalikondwar (Thu, 13 Aug 2020 10:23:24 GMT):
it can happen that the file state will change so we can't gurantee the line vector is legit

sbalikondwar (Thu, 13 Aug 2020 10:23:34 GMT):
so it needs recalculation

sbalikondwar (Thu, 13 Aug 2020 10:24:30 GMT):
plus the time costs for reusing and initiailising a new one is negligble

seanyoung (Thu, 13 Aug 2020 10:25:28 GMT):
In that case, the binary search is just superfluous and is way more complicated than needed.

seanyoung (Thu, 13 Aug 2020 10:25:57 GMT):
You can just scan the file from 0 to offset and count newlines

seanyoung (Thu, 13 Aug 2020 10:26:39 GMT):
To be fair on modern hardware, a linear scan of memory is pretty quick.

seanyoung (Thu, 13 Aug 2020 10:27:10 GMT):
Doing the building of the vector and then doing binary search is just confusing if we're not caching anything

sbalikondwar (Thu, 13 Aug 2020 10:29:25 GMT):
i vote to keep binary search

sbalikondwar (Thu, 13 Aug 2020 10:29:49 GMT):
in future we might optimise the doc sharing and state changes

sbalikondwar (Thu, 13 Aug 2020 10:30:02 GMT):
at that time it will be a major advantage

seanyoung (Thu, 13 Aug 2020 10:33:06 GMT):
Right now the code is confusing because it is has a complex solution which is less efficient than a simple one.

seanyoung (Thu, 13 Aug 2020 10:33:24 GMT):
So either we change it, or document it very clearly in the code

sbalikondwar (Thu, 13 Aug 2020 10:34:36 GMT):
I will document it very clearly

sbalikondwar (Thu, 13 Aug 2020 10:34:50 GMT):
sounds good?

seanyoung (Thu, 13 Aug 2020 10:35:25 GMT):
Sure. Does it make sense why I asking for this?

sbalikondwar (Thu, 13 Aug 2020 10:36:11 GMT):
it makes sense, ok let me work on that

seanyoung (Thu, 13 Aug 2020 10:36:16 GMT):
Thanks

sbalikondwar (Thu, 13 Aug 2020 10:39:30 GMT):
https://www.youtube.com/watch?v=9va8RQEVQmw

sbalikondwar (Thu, 13 Aug 2020 10:41:32 GMT):
it says there are floods! there, quite unusual

seanyoung (Thu, 13 Aug 2020 10:42:22 GMT):
Yes, the weather is very usual at the moment. Landslides because of rain are almost unheard of here.

seanyoung (Thu, 13 Aug 2020 10:44:05 GMT):
It has to be climate change, it makes me very worried and also very sad and disappointed.

sbalikondwar (Thu, 13 Aug 2020 10:45:07 GMT):
Yeah this year was quite rough considering major floods and every climatic phenomenon extreme!

sbalikondwar (Thu, 13 Aug 2020 10:45:07 GMT):
Yeah this year was quite rough considering major floods and every climatic phenomenon at its extreme!

sbalikondwar (Thu, 13 Aug 2020 10:45:49 GMT):
but i see researchers say earth is recovering due to less pollution in lockdown

seanyoung (Thu, 13 Aug 2020 10:47:06 GMT):
Yes, silver lining indeed

sbalikondwar (Thu, 13 Aug 2020 10:49:37 GMT):
well looks like the incident response was quick and life saving

sbalikondwar (Thu, 13 Aug 2020 10:49:37 GMT):
well looks like the incident response was quick and life saving in scotland

sbalikondwar (Thu, 13 Aug 2020 10:50:03 GMT):
anyways back to work

sbalikondwar (Thu, 13 Aug 2020 10:50:18 GMT):
will ping when i fix things

sbalikondwar (Thu, 13 Aug 2020 10:50:18 GMT):
will ping when i fix things on the PR

seanyoung (Thu, 13 Aug 2020 10:54:43 GMT):
it looks like it was dealt with very well, which is great

sbalikondwar (Fri, 14 Aug 2020 11:49:18 GMT):
I am a bit busy today, will join later

sbalikondwar (Fri, 14 Aug 2020 11:49:33 GMT):
Might be there in the weekend

seanyoung (Fri, 14 Aug 2020 11:50:51 GMT):
Hi, sure of course

seanyoung (Sat, 15 Aug 2020 12:44:22 GMT):
Hi @sbalikondwar Just so you're aware -- I've commited this https://github.com/hyperledger-labs/solang/commit/e0e4dba1ffabf6536cf369057746d183bf51218e hope that makes sense

sbalikondwar (Sat, 15 Aug 2020 12:53:50 GMT):
Yes looked at it

sbalikondwar (Sat, 15 Aug 2020 12:53:55 GMT):
Working on adding them

seanyoung (Sat, 15 Aug 2020 12:54:27 GMT):
So I was thinking that solang-server can just drop debug diagnostics

sbalikondwar (Sat, 15 Aug 2020 12:54:59 GMT):
Drop?

seanyoung (Sat, 15 Aug 2020 12:55:33 GMT):
Well, just ignore them and don't add them to diagnostics for vscode

sbalikondwar (Sat, 15 Aug 2020 12:55:41 GMT):
Ok

sbalikondwar (Mon, 17 Aug 2020 09:23:47 GMT):
good morning

sbalikondwar (Mon, 17 Aug 2020 09:24:01 GMT):
updated the search , pub decl

seanyoung (Mon, 17 Aug 2020 09:24:14 GMT):
good morning

sbalikondwar (Mon, 17 Aug 2020 09:24:16 GMT):
just need to work on document and comments in the files

seanyoung (Mon, 17 Aug 2020 09:24:21 GMT):
great

sbalikondwar (Mon, 17 Aug 2020 09:24:25 GMT):
will upload it in sometime today

sbalikondwar (Mon, 17 Aug 2020 09:24:36 GMT):
also added debug support for lsp diagnostics

seanyoung (Mon, 17 Aug 2020 09:24:48 GMT):
perfect, thanks

seanyoung (Mon, 17 Aug 2020 10:23:02 GMT):
I have just updated the llvm dependency to llvm 10 (was llvm 8). If you keep your Cargo.lock file, then you should be fine.

seanyoung (Mon, 17 Aug 2020 10:23:02 GMT):
I have just updated the llvm dependency to llvm 10 (was llvm 8 ). If you keep your Cargo.lock file, then you should be fine.

sbalikondwar (Mon, 17 Aug 2020 10:41:09 GMT):
@seanyoung i hope naming server-utils is legal in rust?

sbalikondwar (Mon, 17 Aug 2020 10:41:18 GMT):
or i will go with serverutils

sbalikondwar (Mon, 17 Aug 2020 10:44:51 GMT):
for line coloumn

sbalikondwar (Mon, 17 Aug 2020 10:44:57 GMT):
" // Calculate the line and coloumn from the Loc offset recieved from the parser // Do a linear search till the correct offset location is matched"

sbalikondwar (Mon, 17 Aug 2020 10:48:01 GMT):
and for convert diagnostics " // Convert the diagnostic messages recieved from the solang to lsp diagnostics types. // Returns a vector of diagnostic messages for the client."

seanyoung (Mon, 17 Aug 2020 11:18:01 GMT):
I don't think you can have a dash in an identifier

sbalikondwar (Mon, 17 Aug 2020 11:34:08 GMT):
also for the info on the funactions

sbalikondwar (Mon, 17 Aug 2020 11:34:22 GMT):
i have added it in the file itself as comments

sbalikondwar (Mon, 17 Aug 2020 11:34:54 GMT):
hope it isn't needed in the readme cause there is already some info there.

sbalikondwar (Mon, 17 Aug 2020 11:35:29 GMT):
https://github.com/Hyperion101010/solang-vscode/blob/phase-2/docs/diagnostics.md

sbalikondwar (Mon, 17 Aug 2020 11:35:47 GMT):
sorry this is correct one https://github.com/Hyperion101010/solang-vscode/blob/phase-2/docs/diagnostics.md#wondering-how-this-works

sbalikondwar (Mon, 17 Aug 2020 11:40:53 GMT):
@seanyoung it is giving merge conflicts cause the changes are on wrong branch ?

sbalikondwar (Mon, 17 Aug 2020 11:41:22 GMT):
so i think merge my local branch with master on local will be the fix ?

seanyoung (Mon, 17 Aug 2020 12:10:28 GMT):
you can merge master into your local branch, or rebase your local branch on master

sbalikondwar (Mon, 17 Aug 2020 12:12:22 GMT):
well it works without master i think

sbalikondwar (Mon, 17 Aug 2020 12:12:27 GMT):
i uploaded the changes

sbalikondwar (Mon, 17 Aug 2020 12:12:48 GMT):
i mean i can open PR on non master branches as well

sbalikondwar (Mon, 17 Aug 2020 12:14:06 GMT):
ok cargo clippy is also added and it runs with no issues

sbalikondwar (Mon, 17 Aug 2020 12:15:44 GMT):
reviews please https://github.com/hyperledger-labs/solang-vscode/pull/7/commits/ab371a2deeff93ba5d1975c45b66ede739c69dd4

seanyoung (Mon, 17 Aug 2020 12:45:34 GMT):
I've added review

seanyoung (Mon, 17 Aug 2020 12:45:34 GMT):
I've added a review

sbalikondwar (Mon, 17 Aug 2020 12:52:53 GMT):
there is no debug type in diagnostics lsp type

sbalikondwar (Mon, 17 Aug 2020 12:53:17 GMT):
by ignoring can you elaborate it?

sbalikondwar (Mon, 17 Aug 2020 12:53:38 GMT):
cause if it is a deubg diagnostics from server should i silence it?

sbalikondwar (Mon, 17 Aug 2020 12:53:58 GMT):
when i decleare it as hint type , it is already silenced in the vscode editor

sbalikondwar (Mon, 17 Aug 2020 12:54:18 GMT):
the hints don't appear in the vscode windo/console

sbalikondwar (Mon, 17 Aug 2020 12:54:18 GMT):
the hints don't appear in the vscode window/console

sbalikondwar (Mon, 17 Aug 2020 12:56:01 GMT):
tower-lsp is deleted on my branch https://github.com/Hyperion101010/solang-vscode/tree/phase-2 through which PR is opened

sbalikondwar (Mon, 17 Aug 2020 12:56:13 GMT):
the github messages for PR i am looking into it

seanyoung (Mon, 17 Aug 2020 13:04:34 GMT):
a debug diagnositic should not be converted to lsp diagnostic

seanyoung (Mon, 17 Aug 2020 13:04:42 GMT):
like it never existed

sbalikondwar (Mon, 17 Aug 2020 13:05:14 GMT):
ok, so like a blank diagnostic vector entry, right

seanyoung (Mon, 17 Aug 2020 13:05:56 GMT):
no, not a blank entry. no entry at all

sbalikondwar (Mon, 17 Aug 2020 13:06:38 GMT):
yes :slight_smile:

seanyoung (Mon, 17 Aug 2020 13:25:43 GMT):
:grinning:

sbalikondwar (Mon, 17 Aug 2020 14:11:05 GMT):
ok i have fixed the diagnostic issue

sbalikondwar (Mon, 17 Aug 2020 14:11:14 GMT):
now just working on the merge conflicts

sbalikondwar (Mon, 17 Aug 2020 14:12:21 GMT):
@seanyoung some help here please

sbalikondwar (Mon, 17 Aug 2020 14:12:22 GMT):
Conflicting files README.md src/client/extension.ts src/test/suite/extension.test.ts src/test/suite/helper.ts

sbalikondwar (Mon, 17 Aug 2020 14:12:36 GMT):
i am bit confused by what i need to do to fix this

sbalikondwar (Mon, 17 Aug 2020 14:14:15 GMT):
what i am thinking is , i need to pull and merge the solang-vscode and then upload on the phase-2 branch

seanyoung (Mon, 17 Aug 2020 15:32:17 GMT):
So since you have merge conflicts, this can't be done automatically

seanyoung (Mon, 17 Aug 2020 15:33:04 GMT):
You can do "git merge origin/master" locally, and this will happen: ``` [sean@xywoleh solang-vscode]$ git merge origin/master CONFLICT (add/add): Merge conflict in src/test/suite/helper.ts Auto-merging src/test/suite/helper.ts CONFLICT (add/add): Merge conflict in src/test/suite/extension.test.ts Auto-merging src/test/suite/extension.test.ts CONFLICT (add/add): Merge conflict in src/client/extension.ts Auto-merging src/client/extension.ts CONFLICT (add/add): Merge conflict in README.md Auto-merging README.md Automatic merge failed; fix conflicts and then commit the result. [sean@xywoleh solang-vscode]$ ```

seanyoung (Mon, 17 Aug 2020 15:34:41 GMT):
Now open those files in vscode. You can see the conflicts. You'll have to manually edit each file manually. Once you are happy with contents, and all tests pass again, do the following: [sean@xywoleh solang-vscode]$ git add src/test/suite/helper.ts src/test/suite/extension.test.ts src/client/extension.ts README.md [sean@xywoleh solang-vscode]$ git merge --continue

seanyoung (Mon, 17 Aug 2020 15:34:41 GMT):
Now open those files in vscode. You can see the conflicts. You'll have to manually edit each file manually. Once you are happy with contents, and all tests pass again, do the following: ``` [sean@xywoleh solang-vscode]$ git add src/test/suite/helper.ts src/test/suite/extension.test.ts src/client/extension.ts README.md [sean@xywoleh solang-vscode]$ git merge --continue ```

seanyoung (Mon, 17 Aug 2020 15:35:27 GMT):
I think you started the phase-2 work from the wrong branch.

seanyoung (Mon, 17 Aug 2020 15:35:47 GMT):
Next time, once everything is merged, start from origin/master

seanyoung (Mon, 17 Aug 2020 15:35:51 GMT):
for phase-3

sbalikondwar (Mon, 17 Aug 2020 15:37:14 GMT):
Yes I merged then successfully thanks

sbalikondwar (Mon, 17 Aug 2020 15:37:14 GMT):
Yes I merged them successfully thanks

sbalikondwar (Mon, 17 Aug 2020 15:37:19 GMT):
Will upload now

sbalikondwar (Mon, 17 Aug 2020 15:37:35 GMT):
I agree u started work on wrong branch

sbalikondwar (Mon, 17 Aug 2020 15:37:35 GMT):
I agree i started work on wrong branch

sbalikondwar (Mon, 17 Aug 2020 15:53:30 GMT):
@seanyoung done

sbalikondwar (Mon, 17 Aug 2020 15:53:49 GMT):
there is one commend in review which can't be resolved can you delete it?

sbalikondwar (Mon, 17 Aug 2020 15:54:06 GMT):

Screenshot from 2020-08-17 21-23-53.png

sbalikondwar (Mon, 17 Aug 2020 16:09:10 GMT):
there was one change requested in past for tower-lsp but now i have removed it and thus it no more visible to resolve

sbalikondwar (Mon, 17 Aug 2020 16:09:20 GMT):
you need to resolve it on your end

sbalikondwar (Mon, 17 Aug 2020 18:41:57 GMT):
By the way how was the weekend

sbalikondwar (Mon, 17 Aug 2020 18:43:15 GMT):
I got a hair cut and some reading

sbalikondwar (Mon, 17 Aug 2020 18:44:16 GMT):
Logging off for today

sbalikondwar (Mon, 17 Aug 2020 18:44:23 GMT):
See you tomorrow

seanyoung (Mon, 17 Aug 2020 21:22:49 GMT):
My weekend wasn't very exciting. I've been working on implement inherited contracts in solang. Solidity inheritance looks very much like C++, and the rules are quite complex. Since me and my wife are at home all the time, we thought we would get a puppy and we're going to pick it next Monday! We're very excited.

seanyoung (Mon, 17 Aug 2020 21:24:10 GMT):
So I approved your pull request, but there is a message on the pull request saying that it cannot be rebased. The github repo is controlled by hyperledger, I can't see a way to enable merging with a merge commit.

sbalikondwar (Mon, 17 Aug 2020 21:24:30 GMT):
Me too I saw the GitHub issue

seanyoung (Mon, 17 Aug 2020 21:24:34 GMT):
The problem is that you have a few commits, and then some changes from master *after* that

sbalikondwar (Mon, 17 Aug 2020 21:24:45 GMT):
Write access people need to do it

seanyoung (Mon, 17 Aug 2020 21:24:52 GMT):
So you can fix it like so: ``` git rebase origin/master ```

seanyoung (Mon, 17 Aug 2020 21:25:39 GMT):
then your branch will no longer have the last commit where you merge from master; the branch will be based on origin/master and then new work

seanyoung (Mon, 17 Aug 2020 21:26:12 GMT):
I can change some settings, but only a few. Not this.

sbalikondwar (Mon, 17 Aug 2020 21:26:33 GMT):
Ok will make those changes tomorrow

seanyoung (Mon, 17 Aug 2020 21:26:51 GMT):
After you do `git rebase origin/master` you should be able to force push your branch and then press the merge button.

sbalikondwar (Mon, 17 Aug 2020 21:26:56 GMT):
Looks like much more if cleaning than fixing things now

seanyoung (Mon, 17 Aug 2020 21:26:56 GMT):
it's pretty late for you!

sbalikondwar (Mon, 17 Aug 2020 21:27:39 GMT):
Ah, I have some schedule so I sleep around 3:30-4 at night

seanyoung (Mon, 17 Aug 2020 21:27:43 GMT):
Anyway I really like it. If you type solidity in vscode the diagnostics come through pretty quick! And we have done very little optimization.

sbalikondwar (Mon, 17 Aug 2020 21:27:56 GMT):
And then wake around 9

seanyoung (Mon, 17 Aug 2020 21:28:18 GMT):
So you sleep for 5 and half hours?

sbalikondwar (Mon, 17 Aug 2020 21:28:34 GMT):
Around 6 to be exact

seanyoung (Mon, 17 Aug 2020 21:29:12 GMT):
Wow I always feel like my days are too short. I'd like to be able to do that!

seanyoung (Mon, 17 Aug 2020 21:29:21 GMT):
How do you manage?

sbalikondwar (Mon, 17 Aug 2020 21:29:53 GMT):
I am a bit jealous I too wanted to have one but family members say I'll have to maintain the puppy and plus it's an apartment so difficult to have a place for dog

sbalikondwar (Mon, 17 Aug 2020 21:31:53 GMT):
It's more like a practice now Due to all the end moment assignment of University and living with college colleagues which are natural to stay up late

sbalikondwar (Mon, 17 Aug 2020 21:32:38 GMT):
But in this pandemic I fear the senior year will be spent in isolation

sbalikondwar (Mon, 17 Aug 2020 21:32:51 GMT):
Anyways will head to bed, see you

sbalikondwar (Tue, 18 Aug 2020 08:49:43 GMT):
ok i resolved conflicts

sbalikondwar (Tue, 18 Aug 2020 08:53:41 GMT):
good morning @seanyoung

sbalikondwar (Tue, 18 Aug 2020 08:56:11 GMT):
the merge button is not present on my end, i think its for the reviewer

sbalikondwar (Tue, 18 Aug 2020 08:56:26 GMT):

Screenshot from 2020-08-18 14-26-14.png

seanyoung (Tue, 18 Aug 2020 09:28:42 GMT):
good morning/afternoon

seanyoung (Tue, 18 Aug 2020 09:29:01 GMT):
I've pressed the merge button. So that's eval 2 done, great!

sbalikondwar (Tue, 18 Aug 2020 10:01:38 GMT):
great! , thanks

sbalikondwar (Tue, 18 Aug 2020 10:02:16 GMT):
feels good to have gifs in place on the official repo

sbalikondwar (Tue, 18 Aug 2020 10:07:02 GMT):
For today I am looking into the next features to work on

sbalikondwar (Tue, 18 Aug 2020 10:07:22 GMT):
will discuss them in tomorrows meet

sbalikondwar (Tue, 18 Aug 2020 10:07:53 GMT):
how does that sound?

seanyoung (Tue, 18 Aug 2020 10:08:18 GMT):
that sounds good. We discus things today if that is better for you

seanyoung (Tue, 18 Aug 2020 10:08:24 GMT):
up to you

sbalikondwar (Tue, 18 Aug 2020 10:08:57 GMT):
well i will have to lookup on the upcoming things and do some research

sbalikondwar (Tue, 18 Aug 2020 10:09:01 GMT):
so tomorrow is better

seanyoung (Tue, 18 Aug 2020 10:09:07 GMT):
ok

sbalikondwar (Wed, 19 Aug 2020 11:07:50 GMT):
good morning

seanyoung (Wed, 19 Aug 2020 11:08:18 GMT):
good morning

sbalikondwar (Wed, 19 Aug 2020 11:41:28 GMT):
https://docs.rs/lsp-types/0.77.0/lsp_types/struct.HoverParams.html

sbalikondwar (Wed, 19 Aug 2020 11:41:50 GMT):
https://docs.rs/lsp-types/0.77.0/lsp_types/struct.Hover.html

seanyoung (Wed, 19 Aug 2020 11:49:36 GMT):
Recursing an expression: https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L486

seanyoung (Wed, 19 Aug 2020 11:52:54 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L310

seanyoung (Wed, 19 Aug 2020 11:54:00 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/mutability.rs#L7

sbalikondwar (Wed, 19 Aug 2020 16:33:38 GMT):
Logging off for today Working on the inputs

sbalikondwar (Wed, 19 Aug 2020 16:33:46 GMT):
See you tomorrow

seanyoung (Wed, 19 Aug 2020 17:09:00 GMT):
see you tomorrow

sbalikondwar (Thu, 20 Aug 2020 08:24:09 GMT):
good morning

seanyoung (Thu, 20 Aug 2020 09:04:32 GMT):
good morning How are you getting on?

sbalikondwar (Thu, 20 Aug 2020 09:12:29 GMT):
studying sema, looked on namespace

sbalikondwar (Thu, 20 Aug 2020 09:12:56 GMT):
understanding the workflow of the ast generation

sbalikondwar (Thu, 20 Aug 2020 09:20:16 GMT):
so for eval3 i have my master branch with some dirty(old) commits which i want to resolve

sbalikondwar (Thu, 20 Aug 2020 09:20:43 GMT):
i think i will have to do a hard reset on my master and then push it on my fork

sbalikondwar (Thu, 20 Aug 2020 09:25:30 GMT):
c57e98 (HEAD -> master) Initial commit 9448805 (origin/master) Merge pull request #7 from Hyperion101010/actions-branch 72919e5 (origin/actions-branch) Merge branch 'master' into actions-branch d8ce972 (upstream/actions-branch) Add ci actions to the repo. 6d8384d Merge pull request #6 from Hyperion101010/actions-branch 7aca635 Merge branch 'master' into actions-branch b373056 Add ci actions to the repo. ff960ae Merge pull request #5 from Hyperion101010/actions-branch 5e69a93 Add ci actions to the repo. 97df1e2 Merge pull request #4 from Hyperion101010/p1_work 06b10ff (upstream/p1_work, origin/p1_work) Added some doc for readme. 8edb96c Tests working fine now. dceed56 Merge pull request #3 from seanyoung/make-test-work 6dd4481 Increase timeout to make test work 1bfd9c8 Merge pull request #2 from Hyperion101010/p1_work 01e6cd2 Fix up on the build/operation failure. 6c3ff46 [WIP]: Message request and response working. c3bff6b WIP: Communicate with rust lsp 0f353af Merge pull request #1 from seanyoung/server-start b9464eb (sean/server-start) Make server attach work 11d8d82 (upstream/master, sean/master) Fix the server and client attach problem. ae73943 Follow up on client side request.

sbalikondwar (Thu, 20 Aug 2020 09:25:40 GMT):
its very bad

seanyoung (Thu, 20 Aug 2020 09:26:12 GMT):
It might be a good idea to first get all commits you want merged into the repo before you start work

seanyoung (Thu, 20 Aug 2020 09:26:30 GMT):
we can merge those and then base your eval 3 work from the latest master

sbalikondwar (Thu, 20 Aug 2020 09:26:34 GMT):
well i have merged the needed for this eval

sbalikondwar (Thu, 20 Aug 2020 09:26:59 GMT):
so will have to sync it with the hyperledger labs repo

seanyoung (Thu, 20 Aug 2020 09:28:54 GMT):
so if you sync with the hyperledger-labs repo and then create a new branch of it ``` git remote update git checkout -b eval3 origin/master ```

seanyoung (Thu, 20 Aug 2020 09:29:04 GMT):
that assumes your labs remote is origin

sbalikondwar (Thu, 20 Aug 2020 09:30:04 GMT):
I did git update

sbalikondwar (Thu, 20 Aug 2020 09:30:04 GMT):
I did git remote update

sbalikondwar (Thu, 20 Aug 2020 09:30:20 GMT):
and git reset --hard labs/master

sbalikondwar (Thu, 20 Aug 2020 09:30:27 GMT):
hope that also works?

seanyoung (Thu, 20 Aug 2020 09:30:27 GMT):
ah ok

seanyoung (Thu, 20 Aug 2020 09:30:33 GMT):
that is also ok

sbalikondwar (Thu, 20 Aug 2020 09:30:49 GMT):
from there i can open a eval3 branch

seanyoung (Thu, 20 Aug 2020 09:31:15 GMT):
alternatively you can rename your branch to eval3 ``` git branch -m eval3 ```

seanyoung (Thu, 20 Aug 2020 09:31:29 GMT):
(or whatever you would like it to be called)

sbalikondwar (Thu, 20 Aug 2020 09:31:51 GMT):
sure

seanyoung (Thu, 20 Aug 2020 09:31:51 GMT):
or create a new branch ``` git checkout -b eval3 ```

sbalikondwar (Thu, 20 Aug 2020 09:33:07 GMT):
I was just trying to experiment with sema lib and functions so wanted to sync up the work before

sbalikondwar (Thu, 20 Aug 2020 09:33:22 GMT):
and then work on new branch

sbalikondwar (Thu, 20 Aug 2020 17:37:22 GMT):
Logging off for today, see you tomorrow

seanyoung (Thu, 20 Aug 2020 18:15:26 GMT):
see you tomorrow

sbalikondwar (Fri, 21 Aug 2020 14:29:22 GMT):
good evening

seanyoung (Fri, 21 Aug 2020 14:35:13 GMT):
good evening

sbalikondwar (Fri, 21 Aug 2020 14:44:52 GMT):
i was busy today because of the festivities

seanyoung (Fri, 21 Aug 2020 14:52:21 GMT):
what festivities are there?

sbalikondwar (Fri, 21 Aug 2020 14:53:40 GMT):
https://www.hindustantimes.com/art-and-culture/ganesh-chaturthi-2020-history-significance-date-and-time-of-the-festival/story-7l2LMUcL25gPEN4FcKo7II.html

sbalikondwar (Fri, 21 Aug 2020 14:55:00 GMT):
Its a kind of a 10 day festival, where there is some rituals taking place to maintain positivity and peace in house

sbalikondwar (Fri, 21 Aug 2020 14:55:00 GMT):
Its a kind of a 10 day festival, where there are some rituals taking place to maintain positivity and peace in house

sbalikondwar (Fri, 21 Aug 2020 14:56:38 GMT):
the rituals are followed by public gathering of people nearby each evening, sort of community thing

seanyoung (Fri, 21 Aug 2020 14:57:08 GMT):
interestring, sound very nice

seanyoung (Fri, 21 Aug 2020 14:57:08 GMT):
interesting, sound very nice

sbalikondwar (Fri, 21 Aug 2020 14:57:32 GMT):
but its not celebrated for straight 10 days, it just starts from one day and the person doesn't has to take off from the work

sbalikondwar (Fri, 21 Aug 2020 14:57:46 GMT):
so i will be working through the weekend

seanyoung (Fri, 21 Aug 2020 14:58:28 GMT):
well you'll already ahead of schedule

sbalikondwar (Fri, 21 Aug 2020 14:59:52 GMT):
yeah, https://www.hindustantimes.com/more-lifestyle/hartalika-teej-2020-date-and-significance-of-the-hindu-festival-in-india/story-XVPToZNktcOKt2XLFI3HCL.html

sbalikondwar (Fri, 21 Aug 2020 15:00:31 GMT):
one festival followed by other :laughing: sometimes it gets too confusing for a new person

sbalikondwar (Fri, 21 Aug 2020 15:01:48 GMT):
anyways what are you doing this weekend

seanyoung (Fri, 21 Aug 2020 15:03:29 GMT):
this is all totally new to me

seanyoung (Fri, 21 Aug 2020 15:05:36 GMT):
we don't have many plans, we will go to the park for a picnic. There is a local park here with dear and other wildlife like owls and woodpeckers.

sbalikondwar (Fri, 21 Aug 2020 15:06:54 GMT):
seems interesting, a wildlife sanctuary ?

sbalikondwar (Fri, 21 Aug 2020 15:07:46 GMT):
i will be working on some algorithms this week if i get time

seanyoung (Fri, 21 Aug 2020 15:07:49 GMT):
It's richmond park, https://www.youtube.com/watch?v=2W5FmVhzzLM

seanyoung (Fri, 21 Aug 2020 15:09:38 GMT):
I really enjoy working on algorithms

sbalikondwar (Fri, 21 Aug 2020 15:13:41 GMT):
wow, the park looks good, be safe (animals can be dangerous when there are no safeguards)

sbalikondwar (Fri, 21 Aug 2020 15:15:39 GMT):
the parks that i am used to here, habitat leopards and all dangerous creatures so i have only visited once in a lifetime

seanyoung (Fri, 21 Aug 2020 15:17:13 GMT):
That's fantastic, we don't have anything like that here

sbalikondwar (Fri, 21 Aug 2020 15:18:28 GMT):
https://traveltriangle.com/blog/national-parks-in-maharashtra/

sbalikondwar (Fri, 21 Aug 2020 15:20:13 GMT):
anyways I shall not disturb from work

sbalikondwar (Fri, 21 Aug 2020 15:20:13 GMT):
anyways I shall not disturb you from work

sbalikondwar (Fri, 21 Aug 2020 17:59:56 GMT):
Logging off for today

sbalikondwar (Fri, 21 Aug 2020 18:00:03 GMT):
Enjoy weekend and trip

seanyoung (Fri, 21 Aug 2020 18:00:40 GMT):
Speak to you soon, enjoy your weekend

seanyoung (Mon, 24 Aug 2020 11:20:54 GMT):
Hello @sbalikondwar The national parks in Maharashtra look fantastic. I hope to visit one day!

sbalikondwar (Mon, 24 Aug 2020 11:36:53 GMT):
good afternoon @seanyoung

sbalikondwar (Mon, 24 Aug 2020 11:37:35 GMT):
i got mail from min and i can send the expense for 2nd eval so I will complete it today and you shall recieve the feedback report details soon after

sbalikondwar (Mon, 24 Aug 2020 11:37:51 GMT):
just giving a heads up

seanyoung (Mon, 24 Aug 2020 11:38:02 GMT):
Oh good

sbalikondwar (Mon, 24 Aug 2020 11:39:02 GMT):
yeah well to be frank, I myself haven't visited the parks but i am sure i future can host one :grin:

sbalikondwar (Mon, 24 Aug 2020 11:39:02 GMT):
yeah well to be frank, I myself haven't visited the parks but i am sure future can host one :grin:

sbalikondwar (Mon, 24 Aug 2020 11:39:57 GMT):
also i tried to compile solang and use solang looks i will have to update my llvm

sbalikondwar (Mon, 24 Aug 2020 11:39:57 GMT):
also i tried to compile solang and use sema looks i will have to update my llvm

seanyoung (Mon, 24 Aug 2020 11:40:23 GMT):
Yes, solang uses llvm 10 now. llvm 8 is already a bit old

sbalikondwar (Mon, 24 Aug 2020 11:40:57 GMT):
for the time being i am using an old solang rev just to experiment

seanyoung (Mon, 24 Aug 2020 11:42:13 GMT):
Other than llvm 10, not much has changed so you can just an old solang.

sbalikondwar (Mon, 24 Aug 2020 11:42:49 GMT):
also it will be good have a fmt implementation on namespace struct? (just a suggestion)

sbalikondwar (Mon, 24 Aug 2020 11:42:49 GMT):
also it will be good have a fmt Debug implementation on namespace struct? (just a suggestion)

seanyoung (Mon, 24 Aug 2020 11:43:21 GMT):
alternatively you can use the llvm10 build from solang ci: $ docker run --rm -it hyperledgerlabs/solang:ci # tar zxf llvm10.tar.gz /llvm10.0 (now copy the file to your local system)

seanyoung (Mon, 24 Aug 2020 11:44:12 GMT):
Debug would be good on namespace, but it will be a big unreadable mess. We really need a nicer way of printing the ast.

seanyoung (Mon, 24 Aug 2020 11:44:35 GMT):
I am certainly not against having debug on it, it just whether there is a better solution

sbalikondwar (Mon, 24 Aug 2020 11:46:21 GMT):
yeah there might be an efficient solution for ast printing

seanyoung (Mon, 24 Aug 2020 11:54:06 GMT):
I've been dithering on this for some time. I'm not sure if should be a text format or other format which could be rendered graphically.

seanyoung (Mon, 24 Aug 2020 11:54:18 GMT):
In some sense anything would be better than nothing :)

sbalikondwar (Mon, 24 Aug 2020 11:56:27 GMT):
well i am trying the same by using the symbols from sema namespace recieved from parse_and_resolve

sbalikondwar (Mon, 24 Aug 2020 11:57:58 GMT):
graphical seems more like a complex way for a simple problem

seanyoung (Mon, 24 Aug 2020 11:59:11 GMT):
Possibly we could do something like the output of `cargo tree`, where the tree-like structure is made clear with some lines

sbalikondwar (Mon, 24 Aug 2020 12:00:00 GMT):
yes thats good, might keep terminal formatting in mind

sbalikondwar (Mon, 24 Aug 2020 14:41:57 GMT):
https://www.youtube.com/watch?v=0OZbeXTCe0A

sbalikondwar (Mon, 24 Aug 2020 14:41:57 GMT):
https://www.youtube.com/watch?v=0OZbeXTCe0A the world's highest bridge in construction!

seanyoung (Mon, 24 Aug 2020 14:43:36 GMT):
That is huge!

sbalikondwar (Mon, 24 Aug 2020 14:48:41 GMT):
does parse and resolve populate the namespace functions field?

sbalikondwar (Mon, 24 Aug 2020 14:49:23 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L82

sbalikondwar (Mon, 24 Aug 2020 14:50:02 GMT):
i just called a parse and resolve and after that looked in the namespace to print some functions from the ast

seanyoung (Mon, 24 Aug 2020 14:50:41 GMT):
yes, all the fields should be populated, unless there was a parse error and parsing had to end early. In this case there will diagnostics of course

sbalikondwar (Mon, 24 Aug 2020 14:51:00 GMT):
oh ok, i will check it

sbalikondwar (Mon, 24 Aug 2020 14:52:42 GMT):
by the way what do you saw in the park

sbalikondwar (Mon, 24 Aug 2020 14:53:34 GMT):
it must have been refreshing after all this lockdown

seanyoung (Mon, 24 Aug 2020 14:55:33 GMT):
The park was very relaxing. We saw some dear, including young ones.

seanyoung (Mon, 24 Aug 2020 14:55:46 GMT):
How was your weekend?

sbalikondwar (Mon, 24 Aug 2020 14:58:37 GMT):
I did some part in festivities, felt bit lazy throughout the weekend

sbalikondwar (Mon, 24 Aug 2020 14:59:41 GMT):
i guess being busy is the way to keep body free from this state

sbalikondwar (Mon, 24 Aug 2020 14:59:58 GMT):
we have some presentation of full time mentee tomorrow

sbalikondwar (Mon, 24 Aug 2020 15:00:17 GMT):
just dropping a notification if you recieved the mail

seanyoung (Mon, 24 Aug 2020 15:00:47 GMT):
Yes, I did see that.

seanyoung (Mon, 24 Aug 2020 15:00:56 GMT):
I thought it was Wednesday though

sbalikondwar (Mon, 24 Aug 2020 15:01:44 GMT):
oh my mistake its on wednesday

sbalikondwar (Mon, 24 Aug 2020 15:02:13 GMT):
i recieved another mail of 25 and i got confused after that

seanyoung (Mon, 24 Aug 2020 15:08:15 GMT):
It will be interesting to see what people have done

sbalikondwar (Mon, 24 Aug 2020 15:19:10 GMT):
yes, i am also curious about their work

sbalikondwar (Mon, 24 Aug 2020 18:55:05 GMT):
Logging off for today Good day

seanyoung (Mon, 24 Aug 2020 18:55:20 GMT):
Good evening

sbalikondwar (Tue, 25 Aug 2020 13:50:13 GMT):
good evening

seanyoung (Tue, 25 Aug 2020 13:50:24 GMT):
Good evening

seanyoung (Tue, 25 Aug 2020 13:50:27 GMT):
how are you getting on?

sbalikondwar (Tue, 25 Aug 2020 14:02:52 GMT):
i am interacting with the namespace, working on the structure

sbalikondwar (Tue, 25 Aug 2020 17:46:20 GMT):
I sent the report and expense to min so min might contact you for the eval

sbalikondwar (Tue, 25 Aug 2020 17:46:35 GMT):
Logging off for today

seanyoung (Tue, 25 Aug 2020 17:46:54 GMT):
Great, have a good evening and speak to your tomorrow

seanyoung (Tue, 25 Aug 2020 17:46:54 GMT):
Great, have a good evening and speak to you tomorrow

sbalikondwar (Tue, 25 Aug 2020 17:46:59 GMT):
I was busy a bit today

sbalikondwar (Tue, 25 Aug 2020 17:47:11 GMT):
Sure See you good day

sbalikondwar (Tue, 25 Aug 2020 17:47:47 GMT):
I went for passport verification today so joined in evening

seanyoung (Tue, 25 Aug 2020 17:48:28 GMT):
passport verification for hyperledger?

sbalikondwar (Tue, 25 Aug 2020 17:48:57 GMT):
Nah issue of a new india n passport 😅

seanyoung (Tue, 25 Aug 2020 17:49:22 GMT):
ah ok :) Hope that went ok.

sbalikondwar (Tue, 25 Aug 2020 17:49:26 GMT):
I applied a while back and today had the appointment for document verification

sbalikondwar (Tue, 25 Aug 2020 17:50:10 GMT):
Yes it went good, I shall recieve my new passport soon

sbalikondwar (Tue, 25 Aug 2020 17:50:47 GMT):
See you then!

seanyoung (Tue, 25 Aug 2020 17:50:53 GMT):
See you!

sbalikondwar (Wed, 26 Aug 2020 08:46:15 GMT):
hi there

sbalikondwar (Wed, 26 Aug 2020 08:46:22 GMT):
i am doing something like

sbalikondwar (Wed, 26 Aug 2020 08:46:23 GMT):
let mut filecache = FileCache::new(); let filecachepath = Path::new("src/sample.sol"); let tostrpath = filecachepath.to_str().unwrap(); let mut p = PathBuf::new(); p.push(tostrpath.to_string()); filecache.add_import_path(p); let os_str = filecachepath.file_name().unwrap(); let ns = parse_and_resolve(os_str.to_str().unwrap(), &mut filecache, Target::Ewasm); let fileconts = filecache.get_file_contents(&os_str.to_str().unwrap()[..]); for samp in ns.contracts.iter(){ // for printing all functions name in the for abc in samp.functions.iter(){ println!("{}", abc.name); } }

sbalikondwar (Wed, 26 Aug 2020 08:46:50 GMT):
my file is in src/sample.sol in the cargo project

sbalikondwar (Wed, 26 Aug 2020 08:47:07 GMT):
thread 'main' panicked at 'file should exist in cache already', /home/hyperion/.cargo/git/checkouts/solang-98203f5abd7a90ef/6c8fa63/src/file_cache.rs:54:14

seanyoung (Wed, 26 Aug 2020 09:31:54 GMT):
Hi This means the file is not found. The error message certainly can be better.

seanyoung (Wed, 26 Aug 2020 09:32:13 GMT):
there is no src/sample.sol in the solang-vscode repo

sbalikondwar (Wed, 26 Aug 2020 09:32:32 GMT):
no i just made a dummy cargo project to test out the ast

seanyoung (Wed, 26 Aug 2020 09:33:50 GMT):
`filecache.add_import_path(p);` expects a directory, not a file

sbalikondwar (Wed, 26 Aug 2020 09:34:09 GMT):
a pathbuf right ?

seanyoung (Wed, 26 Aug 2020 09:34:38 GMT):
a pathbuf is just a file path file or directory

sbalikondwar (Wed, 26 Aug 2020 09:34:45 GMT):
ok

seanyoung (Wed, 26 Aug 2020 09:35:05 GMT):
like `src/sample.sol`

seanyoung (Wed, 26 Aug 2020 09:36:55 GMT):
Also `filecache.add_import_path(p);` expects the canonicalized path, like so: https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.canonicalize

sbalikondwar (Wed, 26 Aug 2020 09:39:21 GMT):
thanks, working on it

seanyoung (Wed, 26 Aug 2020 10:22:57 GMT):
For test purposes, it might be easier to use the file cache like in the import tests: https://github.com/hyperledger-labs/solang/blob/master/tests/substrate_imports/mod.rs

sbalikondwar (Wed, 26 Aug 2020 11:23:24 GMT):
got meet in 7-8 minutes

sbalikondwar (Wed, 26 Aug 2020 11:31:25 GMT):
@seanyoung you there

sbalikondwar (Wed, 26 Aug 2020 11:32:33 GMT):
https://pastebin.com/3pfkNVMa

sbalikondwar (Wed, 26 Aug 2020 11:39:59 GMT):
#[derive(Clone, PartialEq)] pub enum Symbol { Enum(pt::Loc, usize), Function(Vec<(pt::Loc, usize)>), Variable(pt::Loc, usize), Struct(pt::Loc, usize), Contract(pt::Loc, usize), Import(pt::Loc, usize), }

seanyoung (Wed, 26 Aug 2020 11:41:23 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L98

sbalikondwar (Wed, 26 Aug 2020 12:03:31 GMT):
tea time :coffee: see you in the project presentation

sbalikondwar (Wed, 26 Aug 2020 12:03:31 GMT):
tea time :coffee: see you during the project presentation

sbalikondwar (Wed, 26 Aug 2020 15:03:31 GMT):
quite informative session, i really liked the iroha and fuzzing one

sbalikondwar (Wed, 26 Aug 2020 15:03:55 GMT):
the mentee's worked hard on their one

sbalikondwar (Wed, 26 Aug 2020 15:03:55 GMT):
the mentee's worked hard on their projects

sbalikondwar (Wed, 26 Aug 2020 15:05:08 GMT):
but still it was evident to miss some aspects and implementation in this short time.

seanyoung (Wed, 26 Aug 2020 15:47:56 GMT):
It is such a short time to learn a lot and writing code just takes a lot of time too. Having said that, some great work was done!

sbalikondwar (Wed, 26 Aug 2020 19:17:48 GMT):
logging off, see you tomororw

sbalikondwar (Wed, 26 Aug 2020 19:17:48 GMT):
logging off, see you tomorrow

sbalikondwar (Wed, 26 Aug 2020 19:17:48 GMT):
logging off, see you tomorow

seanyoung (Wed, 26 Aug 2020 19:32:47 GMT):
See you tomorrow!

sbalikondwar (Fri, 28 Aug 2020 15:28:22 GMT):
good evening

seanyoung (Fri, 28 Aug 2020 15:28:29 GMT):
good evening

sbalikondwar (Fri, 28 Aug 2020 15:28:49 GMT):
i worked for a bit in afternoon and resuming now

sbalikondwar (Fri, 28 Aug 2020 15:29:22 GMT):
so i was working on the symtable, i have found that parser is private

sbalikondwar (Fri, 28 Aug 2020 15:30:04 GMT):
for time being i am using example in solang so as to bypass that

seanyoung (Fri, 28 Aug 2020 15:30:30 GMT):
ah ok so you can't look at the pt::Loc fields for example?

sbalikondwar (Fri, 28 Aug 2020 15:30:54 GMT):
i don't want you to change it for now, once i am done with the example i will give you list of fields needed to be made public

sbalikondwar (Fri, 28 Aug 2020 15:31:35 GMT):
for now i am directly changing solang repo by writing an example so that it doesn't give errors

seanyoung (Fri, 28 Aug 2020 15:33:03 GMT):
Obviously this needs fixing. You can use a local copy of solang: ``` [dependencies] solang = { path = "../solang" } ```

seanyoung (Fri, 28 Aug 2020 15:33:14 GMT):
And keep your fixes there

sbalikondwar (Fri, 28 Aug 2020 15:34:04 GMT):
oh ok, i just made an example in solang/examples

sbalikondwar (Fri, 28 Aug 2020 15:34:13 GMT):
that can also fix it i think

sbalikondwar (Fri, 28 Aug 2020 15:34:54 GMT):
i didn't know that feature, very helpful

sbalikondwar (Fri, 28 Aug 2020 15:44:20 GMT):
I shall be working for sometime this weekend, followup on the work

sbalikondwar (Fri, 28 Aug 2020 15:50:27 GMT):
what about you?

seanyoung (Fri, 28 Aug 2020 15:52:30 GMT):
I'm working on events in Solidity: https://github.com/hyperledger-labs/solang/pull/263 I'm hoping I can finish events this weekend. Once events are done, then function modifiers need implementing. Once that is done, that means all the major langauge features of Solidity are implemented!

sbalikondwar (Fri, 28 Aug 2020 15:53:01 GMT):
great!

seanyoung (Fri, 28 Aug 2020 15:53:01 GMT):
I'm sure bugs will be found but I'm hoping we will see many users of Solang

sbalikondwar (Fri, 28 Aug 2020 15:53:30 GMT):
and for solang-vscode as well :grin:

seanyoung (Fri, 28 Aug 2020 15:53:51 GMT):
Exactly!

sbalikondwar (Fri, 28 Aug 2020 15:54:35 GMT):
besides i plan to participate in some algo contests

seanyoung (Fri, 28 Aug 2020 15:56:58 GMT):
That's great! How do the contests work? Do you have figure out which algorithm to use or implement one?

sbalikondwar (Fri, 28 Aug 2020 15:59:55 GMT):
yes they give you puzzle type problems and then you need to solve them in the least time with the most efficiet algo

sbalikondwar (Fri, 28 Aug 2020 15:59:55 GMT):
yes they give you puzzle type problems and then you need to solve them in the least time with the most efficient algo

sbalikondwar (Fri, 28 Aug 2020 16:00:49 GMT):
https://codeforces.com/gyms

seanyoung (Fri, 28 Aug 2020 16:00:54 GMT):
That's a nice challenge. Can you pick your programming language or do you have to use one they prescibe?

sbalikondwar (Fri, 28 Aug 2020 16:01:08 GMT):
yes you can pick your own language

sbalikondwar (Fri, 28 Aug 2020 16:02:17 GMT):
but it can be quite a headache sometimes when you can't solve the puzzles

sbalikondwar (Fri, 28 Aug 2020 16:03:01 GMT):
still its a very good way to brainstorm and learn new algos

seanyoung (Fri, 28 Aug 2020 16:03:02 GMT):
wow these are hard problems

sbalikondwar (Fri, 28 Aug 2020 16:12:12 GMT):
indeed

sbalikondwar (Fri, 28 Aug 2020 18:33:03 GMT):
logging off, see you tomorrow (well if you are working else enjoy weekend)

seanyoung (Fri, 28 Aug 2020 18:42:52 GMT):
see you tomorrow

sbalikondwar (Sun, 30 Aug 2020 16:13:15 GMT):
hi there, just dropping by for today

sbalikondwar (Sun, 30 Aug 2020 16:13:55 GMT):
worked on the ast part, progressing on the accessing of function_def

sbalikondwar (Sun, 30 Aug 2020 16:14:04 GMT):
and function_decl

sbalikondwar (Sun, 30 Aug 2020 16:14:26 GMT):
will join in tomorrow, see you good day

sbalikondwar (Sun, 30 Aug 2020 16:14:26 GMT):
will follow up tomorrow, see you good day

sbalikondwar (Sun, 30 Aug 2020 16:15:41 GMT):
and that suggested cargo changes to use local solang and public decl worked like a charm

seanyoung (Sun, 30 Aug 2020 17:27:17 GMT):
Hi there Feel free to make a PR in Solang with your changes

seanyoung (Sun, 30 Aug 2020 17:27:30 GMT):
whenever suits you of course

sbalikondwar (Mon, 31 Aug 2020 14:48:00 GMT):
good evening

seanyoung (Mon, 31 Aug 2020 14:48:56 GMT):
Good evening How are you getting on?

sbalikondwar (Mon, 31 Aug 2020 14:50:46 GMT):
I am able to locate where the function defs are present, then i am working on the iterators to extract the symtable from it

sbalikondwar (Mon, 31 Aug 2020 15:42:12 GMT):
hoe to use & referenced option @seanyoung

sbalikondwar (Mon, 31 Aug 2020 15:42:12 GMT):
how to use & referenced option @seanyoung

sbalikondwar (Mon, 31 Aug 2020 15:42:52 GMT):
i have for (ln, pt_p, fdef) in fnc_bodies { //let ans = *fdef.params; for (a,b) in &fdef.params { /* let c = *b; let d = c.unwrap(); let d = d.name.unwrap(); */ let d = *b.unwrap().name.unwrap(); } }

sbalikondwar (Mon, 31 Aug 2020 15:44:00 GMT):
here fdef is &solang::parser::pt::FunctionDefinition, and b is &std::option::Option

sbalikondwar (Mon, 31 Aug 2020 15:44:00 GMT):
here fdef is &solang::parser"::"pt::FunctionDefinition, and b is &std::option::Option

sbalikondwar (Mon, 31 Aug 2020 15:44:25 GMT):
sorry the "::" is displayed as ::

sbalikondwar (Mon, 31 Aug 2020 15:47:45 GMT):
the d variable is expected to give https://github.com/hyperledger-labs/solang/blob/master/src/parser/pt.rs#L8

sbalikondwar (Mon, 31 Aug 2020 15:47:45 GMT):
the d.name variable is expected to give https://github.com/hyperledger-labs/solang/blob/master/src/parser/pt.rs#L8

seanyoung (Mon, 31 Aug 2020 15:48:41 GMT):
First of all, I'm confused why you're walking the parse tree -- you really need the ast, that what parse_and_resolve() returns

sbalikondwar (Mon, 31 Aug 2020 15:49:31 GMT):
wait there is the symtable

seanyoung (Mon, 31 Aug 2020 15:49:58 GMT):
The parse tree has no symtable -- those are not resolved yet

sbalikondwar (Mon, 31 Aug 2020 15:50:20 GMT):
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=926aebf1437fb5fa311f76313d7e5af8

sbalikondwar (Mon, 31 Aug 2020 15:50:29 GMT):
it has one minute

seanyoung (Mon, 31 Aug 2020 15:51:09 GMT):
So if you have an option, you can't unwrap it unless you know it has Some() in it, and not None

seanyoung (Mon, 31 Aug 2020 15:52:02 GMT):
with an option can test if it has Some() and reference what is inside the Some with: ``` if let Some(n) = b { println!("{:?}", b); } else{ ```

seanyoung (Mon, 31 Aug 2020 15:52:02 GMT):
with an option can test if it has Some() and reference what is inside the Some with: ``` if let Some(n) = b { println!("{:?}", b); } else{ println!("nothing"); } ```

sbalikondwar (Mon, 31 Aug 2020 15:53:24 GMT):
i am accesing this https://github.com/hyperledger-labs/solang/blob/master/src/parser/pt.rs#L453

sbalikondwar (Mon, 31 Aug 2020 15:53:56 GMT):
have you understood my approach now @seanyoung

sbalikondwar (Mon, 31 Aug 2020 15:53:56 GMT):
have you understood my approach now @seanyoung ?

sbalikondwar (Mon, 31 Aug 2020 15:53:56 GMT):
have you understood my approach now @seanyoung ?, I mean i am on right track right?

sbalikondwar (Mon, 31 Aug 2020 15:57:14 GMT):
for now i have used methods from solang for modelling

seanyoung (Mon, 31 Aug 2020 16:01:41 GMT):
That is function after parsing. You should be looking at https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L96

sbalikondwar (Mon, 31 Aug 2020 16:03:37 GMT):
right, I was looking slightly at different position

sbalikondwar (Mon, 31 Aug 2020 16:03:44 GMT):
thanks looking for it.

sbalikondwar (Tue, 01 Sep 2020 12:48:18 GMT):
good afternoon

seanyoung (Tue, 01 Sep 2020 12:48:29 GMT):
Good afternoon

seanyoung (Tue, 01 Sep 2020 12:49:19 GMT):
How are you getting on?

seanyoung (Tue, 01 Sep 2020 12:49:35 GMT):
This morning I've been working on an ast printer, still work in progress: https://github.com/hyperledger-labs/solang/pull/265

sbalikondwar (Tue, 01 Sep 2020 13:10:56 GMT):
so far i have accesed the sym table and experienced the variable names , return in functions

sbalikondwar (Tue, 01 Sep 2020 13:11:01 GMT):
inside contracts

sbalikondwar (Tue, 01 Sep 2020 13:11:19 GMT):
the args and returns are seemsed to be usize

sbalikondwar (Tue, 01 Sep 2020 13:11:26 GMT):
why i can't understand

seanyoung (Tue, 01 Sep 2020 13:12:09 GMT):
The usize is an index into the symbol table.

sbalikondwar (Tue, 01 Sep 2020 13:12:09 GMT):
here https://github.com/hyperledger-labs/solang/blob/master/src/sema/symtable.rs#L19

seanyoung (Tue, 01 Sep 2020 13:14:57 GMT):
So `symtable.arguments[0]` is the first argument. You can use the usize in the vars hashmap: ``` if let Some(first_argument) = &func.arguments[0] { let var = &func.symtable.vars[first_argument]; } ```

seanyoung (Tue, 01 Sep 2020 13:15:47 GMT):
The var is the `Variable` struct which gives you the name and the type

sbalikondwar (Tue, 01 Sep 2020 13:20:51 GMT):
oh so i think i got it, every variable has an id, and inside id.loc is the file offset

sbalikondwar (Tue, 01 Sep 2020 13:21:16 GMT):
while insertion the id is incremented to create a map, and so it can be accesed later

sbalikondwar (Tue, 01 Sep 2020 13:22:13 GMT):
the only thing i am concerned here is about why we only add variables and not return and argument in side the list https://github.com/hyperledger-labs/solang/blob/master/src/sema/symtable.rs#L39

sbalikondwar (Tue, 01 Sep 2020 13:22:13 GMT):
the only thing i am concerned here is about why we only add variables and not return and argument inside the list https://github.com/hyperledger-labs/solang/blob/master/src/sema/symtable.rs#L39

sbalikondwar (Tue, 01 Sep 2020 13:23:40 GMT):
if you can see in the above files, insert is only called for vars and names but we don't insert args and return in the symtable

sbalikondwar (Tue, 01 Sep 2020 13:23:40 GMT):
if you can see in the above symtable.rs file, insert is only called for vars and names but we don't insert args and return in the symtable

sbalikondwar (Tue, 01 Sep 2020 13:49:41 GMT):
ok i got it, the arguments are inserted here https://github.com/hyperledger-labs/solang/blob/master/src/sema/statements.rs#L26

sbalikondwar (Tue, 01 Sep 2020 13:51:27 GMT):
so i will now progress with using the loc offset and writing algo to return the respective tokens. (i think some kind of switch case)

sbalikondwar (Tue, 01 Sep 2020 13:51:27 GMT):
so i will now progress with using the loc offset and writing algo to return the respective tokens. (i think some kind of switch case like impl)

sbalikondwar (Tue, 01 Sep 2020 13:52:17 GMT):
@seanyoung good to hear you got time to work with ast printing

sbalikondwar (Tue, 01 Sep 2020 13:52:32 GMT):
how was your weekend

sbalikondwar (Tue, 01 Sep 2020 13:52:54 GMT):
yesterday i worked for some less than usual

sbalikondwar (Tue, 01 Sep 2020 13:52:54 GMT):
yesterday i worked for less time than usual

seanyoung (Tue, 01 Sep 2020 13:58:39 GMT):
Exactly, the returns are added herehttps://github.com/hyperledger-labs/solang/blob/master/src/sema/statements.rs#L164

seanyoung (Tue, 01 Sep 2020 13:58:39 GMT):
Exactly, the returns are added here https://github.com/hyperledger-labs/solang/blob/master/src/sema/statements.rs#L164

seanyoung (Tue, 01 Sep 2020 14:00:17 GMT):
I had a relaxing weekend, had friends over for the first time since march, so that was very enjoyable. A lot to catch up on.

seanyoung (Tue, 01 Sep 2020 14:00:24 GMT):
How about your weekend?

sbalikondwar (Tue, 01 Sep 2020 14:57:28 GMT):
i was too relaxing most of the time, and worked for some time on the project

sbalikondwar (Tue, 01 Sep 2020 14:58:00 GMT):
i failed to work on algos though

sbalikondwar (Tue, 01 Sep 2020 14:58:00 GMT):
i failed to work on algos contest though

sbalikondwar (Tue, 01 Sep 2020 14:58:43 GMT):
i was also searching for projects using rust and i found most of them are for crypto or blockchain based

sbalikondwar (Tue, 01 Sep 2020 14:59:23 GMT):
are there any exclusive fields/firms using rust nowadays @seanyoung

seanyoung (Tue, 01 Sep 2020 16:19:19 GMT):
So Firefox is being re-written in rust. The linux kernel are considering adding rust https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Rust-Path-LPC2020 I think rust has a bright future: https://thenewstack.io/microsoft-rust-is-the-industrys-best-chance-at-safe-systems-programming/#

seanyoung (Tue, 01 Sep 2020 16:20:11 GMT):
Having said all that, the jobs for rust right now are crypto and blockchain. I think that rust will become more widespread in the future, but the future is hard to predict

sbalikondwar (Tue, 01 Sep 2020 18:09:07 GMT):
Logging off for today

sbalikondwar (Tue, 01 Sep 2020 18:09:12 GMT):
See you tomorrow

sbalikondwar (Tue, 01 Sep 2020 18:09:54 GMT):
Interesting to know the future possibilities and yes it is quite possible it might not turn out as expected

sbalikondwar (Wed, 02 Sep 2020 10:17:38 GMT):
good morning/evening

sbalikondwar (Wed, 02 Sep 2020 10:17:38 GMT):
good morning/afternoon

sbalikondwar (Wed, 02 Sep 2020 10:18:02 GMT):
got meet in nearly an hour

seanyoung (Wed, 02 Sep 2020 10:41:27 GMT):
Good afternoon

sbalikondwar (Wed, 02 Sep 2020 11:35:39 GMT):
https://pastebin.com/SQqmVdqx

sbalikondwar (Wed, 02 Sep 2020 11:35:58 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L96

sbalikondwar (Wed, 02 Sep 2020 11:43:08 GMT):
https://www.geeksforgeeks.org/segment-tree-set-1-sum-of-given-range/

seanyoung (Wed, 02 Sep 2020 11:45:23 GMT):
https://doc.rust-lang.org/std/collections/struct.BTreeMap.html

sbalikondwar (Wed, 02 Sep 2020 11:52:27 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L777

sbalikondwar (Thu, 03 Sep 2020 09:35:10 GMT):
good morning

seanyoung (Thu, 03 Sep 2020 09:56:36 GMT):
good morning

sbalikondwar (Thu, 03 Sep 2020 18:55:15 GMT):
Logging off see you tomorrow

seanyoung (Thu, 03 Sep 2020 18:55:30 GMT):
see you tomorrow

sbalikondwar (Fri, 04 Sep 2020 13:01:36 GMT):
Hi there @seanyoung

sbalikondwar (Fri, 04 Sep 2020 13:02:24 GMT):
Today I have some work so will be there for less time but I will be working in weekends

seanyoung (Fri, 04 Sep 2020 14:01:52 GMT):
Hello Sure

sbalikondwar (Mon, 07 Sep 2020 10:54:18 GMT):
good afternoon

sbalikondwar (Mon, 07 Sep 2020 10:56:30 GMT):
this weekend I worked on the structure of the algo and writting some rust matches for processing

seanyoung (Mon, 07 Sep 2020 12:22:00 GMT):
good afternoon

sbalikondwar (Mon, 07 Sep 2020 15:48:48 GMT):
@seanyoung what should be the message for delete keyword

sbalikondwar (Mon, 07 Sep 2020 15:49:10 GMT):
for variables i have thought it like vartype varname varvalue

sbalikondwar (Mon, 07 Sep 2020 15:49:40 GMT):
for iterations and if/else i it has to be like Keyword( condition )

sbalikondwar (Mon, 07 Sep 2020 15:53:23 GMT):
ok for continue/break/return/delete i think the best will be to just display a helpful hint about its use/meaning

sbalikondwar (Mon, 07 Sep 2020 15:58:59 GMT):
Also can you elaborate/explain the Destructure field in Stataments here https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L792

sbalikondwar (Mon, 07 Sep 2020 15:59:45 GMT):
Also emit and trycatch fields in the same file

sbalikondwar (Mon, 07 Sep 2020 16:00:26 GMT):
for emit i think it has to be a simple message explaining its meaning

sbalikondwar (Mon, 07 Sep 2020 16:01:35 GMT):
emit/destructure aren't keywords right @seanyoung

seanyoung (Mon, 07 Sep 2020 21:14:46 GMT):
Hi Sorry for not answering earlier. I was busy today. In smart contracts, some variables are persisted on chain for the next execution: contract storage or state. With `delete` you can remove the storage from chain storage. With the `emit` keyword you can generate solidity events: https://solidity.readthedocs.io/en/v0.7.1/contracts.html?highlight=emit#events

seanyoung (Mon, 07 Sep 2020 21:17:00 GMT):
Having said all that, I'm not sure that keywords need hover-over events. If you use vscode with rust or C it does not give you explanations of the keywords. It's more useful to have hover-over events for variables, types, and functions etc

seanyoung (Mon, 07 Sep 2020 21:24:50 GMT):
destructure statements are for calling functions with multiple return values. There is no keyword. ``` (var_a, var_b) = foo(); ```

seanyoung (Mon, 07 Sep 2020 21:25:08 GMT):
a bit like `let (a, b) = foo();` in rust

sbalikondwar (Mon, 07 Sep 2020 21:44:40 GMT):
Sure I was also thinking similar to that to provide only hovers for vars and types and iterations

sbalikondwar (Mon, 07 Sep 2020 21:44:55 GMT):
But just thought of some discussion to confirm

sbalikondwar (Mon, 07 Sep 2020 21:45:08 GMT):
Anyways it is quite late today

sbalikondwar (Mon, 07 Sep 2020 21:45:14 GMT):
See you, night

sbalikondwar (Tue, 08 Sep 2020 11:35:16 GMT):
good morning/afternoon

sbalikondwar (Tue, 08 Sep 2020 11:43:42 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/parser/pt.rs#L434 @seanyoung some info on the last two fields as well

sbalikondwar (Tue, 08 Sep 2020 11:44:02 GMT):
what does fallback and recieve mean

seanyoung (Tue, 08 Sep 2020 12:09:10 GMT):
receive and fallback are special functions for when a smart contract gets call for an unknown function. See https://solang.readthedocs.io/en/latest/language.html#fallback-and-receive-function or https://solidity.readthedocs.io/en/v0.7.1/contracts.html?highlight=receive#receive-ether-function

seanyoung (Tue, 08 Sep 2020 12:10:35 GMT):
I'm adding another type modifier https://github.com/hyperledger-labs/solang/pull/270/files#diff-8338fc814ed69eb92490468e159ed8f1R297

sbalikondwar (Tue, 08 Sep 2020 13:56:58 GMT):
pub enum Statement { VariableDecl(pt::Loc, usize, Parameter, Option), If(pt::Loc, bool, Expression, Vec, Vec), While(pt::Loc, bool, Expression, Vec), For { loc: pt::Loc, reachable: bool, init: Vec, cond: Option, next: Vec, body: Vec, }, DoWhile(pt::Loc, bool, Vec, Expression), Expression(pt::Loc, bool, Expression), Delete(pt::Loc, Type, Expression),

sbalikondwar (Tue, 08 Sep 2020 13:57:50 GMT):
in here as you can see for is a struct so i am little confused how to access its content in a match statement

sbalikondwar (Tue, 08 Sep 2020 13:57:50 GMT):
in here as you can see 'For' is a struct so i am little confused how to access its content in a match statement

seanyoung (Tue, 08 Sep 2020 14:06:27 GMT):
With rust match patterns, you can match struct fields. Maybe this recurse function will help: https://github.com/hyperledger-labs/solang/pull/270/files#diff-b2cbee094488d1fad6ecde35fadf303fR840

sbalikondwar (Tue, 08 Sep 2020 15:00:47 GMT):
ok thanks

sbalikondwar (Tue, 08 Sep 2020 15:01:10 GMT):
by the way how was the weekend

seanyoung (Tue, 08 Sep 2020 15:23:03 GMT):
Weekend was ok, I didn't do much. Not very exciting!

seanyoung (Tue, 08 Sep 2020 15:23:08 GMT):
How was your weekend?

sbalikondwar (Tue, 08 Sep 2020 16:01:41 GMT):
I am trying to make some sleep schedules 😭

sbalikondwar (Tue, 08 Sep 2020 16:02:20 GMT):
Else was just some work and leisure

sbalikondwar (Tue, 08 Sep 2020 19:30:32 GMT):
see you tomorrow

sbalikondwar (Wed, 09 Sep 2020 08:48:11 GMT):
good afternoon/morning

seanyoung (Wed, 09 Sep 2020 09:25:23 GMT):
good afternoon

sbalikondwar (Wed, 09 Sep 2020 11:30:03 GMT):
meet today @seanyoung

sbalikondwar (Wed, 09 Sep 2020 11:30:57 GMT):
https://pastebin.com/8ZTLnzLX

seanyoung (Wed, 09 Sep 2020 11:48:51 GMT):
https://solang.readthedocs.io/en/latest/language.html#type-operators

seanyoung (Wed, 09 Sep 2020 11:51:04 GMT):
https://solang.readthedocs.io/en/latest/language.html#fallback-and-receive-function

seanyoung (Wed, 09 Sep 2020 12:04:40 GMT):
https://wiki.hyperledger.org/display/HYP/Calendar+of+Public+Meetings

sbalikondwar (Thu, 10 Sep 2020 11:02:39 GMT):
Afternoon @seanyoung

sbalikondwar (Thu, 10 Sep 2020 11:03:15 GMT):
It's my birthday today 🥳

seanyoung (Thu, 10 Sep 2020 11:11:19 GMT):
Happy birthday, congratulations, do you have any plans?

sbalikondwar (Thu, 10 Sep 2020 11:17:18 GMT):
thank you for the warm wishes :slight_smile:

sbalikondwar (Thu, 10 Sep 2020 11:18:12 GMT):
I have brought a cake, and in the evening there will be some ritual (small one) with some feast

sbalikondwar (Thu, 10 Sep 2020 11:18:12 GMT):
I have brought a cake, and in the evening there will be some ritual (small one) with eve feast

sbalikondwar (Thu, 10 Sep 2020 11:18:50 GMT):
it will be among the family

sbalikondwar (Thu, 10 Sep 2020 11:21:09 GMT):
these are some really delicious dishes https://recipes.timesofindia.com/recipes/daal-baati/rs55130267.cms https://recipes.timesofindia.com/recipes/gosht-dum-biryani/rs54674843.cms

sbalikondwar (Thu, 10 Sep 2020 11:21:09 GMT):
some delicious dishes we are having today https://recipes.timesofindia.com/recipes/daal-baati/rs55130267.cms https://recipes.timesofindia.com/recipes/gosht-dum-biryani/rs54674843.cms

sbalikondwar (Thu, 10 Sep 2020 11:21:28 GMT):
how do people celebrate there?

seanyoung (Thu, 10 Sep 2020 11:38:39 GMT):
That sounds nice!

seanyoung (Thu, 10 Sep 2020 11:39:11 GMT):
Here people usually celebrate with family or with friends, with a birthday cake after dinner.

sbalikondwar (Thu, 10 Sep 2020 11:43:40 GMT):
Great it's quite similar here as well

sbalikondwar (Thu, 10 Sep 2020 11:44:07 GMT):
About the meet with bowman are we doing it today

sbalikondwar (Thu, 10 Sep 2020 11:44:26 GMT):
Or we notifying him for some favourable time

seanyoung (Thu, 10 Sep 2020 11:48:14 GMT):
oh that won't be until at least next week

seanyoung (Thu, 10 Sep 2020 11:48:25 GMT):
we'll figure out a time/date that works for all of us

sbalikondwar (Fri, 11 Sep 2020 13:27:23 GMT):
good afternoon

sbalikondwar (Fri, 11 Sep 2020 13:28:10 GMT):
so as discussed i have focused on working on some specific tokens first to ensure the algo and approach

sbalikondwar (Fri, 11 Sep 2020 15:34:52 GMT):
one doubt

sbalikondwar (Fri, 11 Sep 2020 15:35:23 GMT):
explicit lifetime required in the type of `lookup_tbl` lifetime `'static` requiredrustc(E0621) main.rs(478, 37): lifetime `'static` required

sbalikondwar (Fri, 11 Sep 2020 15:54:10 GMT):
@seanyoung how can i convert a Vec::new() mut vec to &'static type?

sbalikondwar (Fri, 11 Sep 2020 15:54:32 GMT):
i tried like let mut lookup_tbl: Vec<(u64, u64, &str)> = Vec::new(); let lookup_tbl: &'static Vec<(u64, u64, &str)> = Vec::leak(lookup_tbl); but it is wrong

sbalikondwar (Fri, 11 Sep 2020 15:54:32 GMT):
i tried like let mut lookup_tbl: Vec<(u64, u64, &str)> = Vec::new(); let lookup_tbl: &'static Vec<(u64, u64, &str)> = Vec::leak(lookup_tbl); but it is wrong somewhere

seanyoung (Fri, 11 Sep 2020 17:40:22 GMT):
Sorry I've had busy day. The `&'` thing is a lifetime specifier. The static lifetime is only for compile-time constants

KiChjang (Fri, 11 Sep 2020 22:30:08 GMT):
@seanyoung hello again, I'm working on the implicit bytes casting issue right now, and I'm pretty far ahead right now, and the remaining problem I have is casting from bytes to bytesN

KiChjang (Fri, 11 Sep 2020 22:31:10 GMT):
specifically, I tried to use GetElementPtr to get the pointer to the data field of the vector, and then cast this pointer to the corresponding int pointer

KiChjang (Fri, 11 Sep 2020 22:31:28 GMT):
it works in theory, but i forgot to factor in endianness

KiChjang (Fri, 11 Sep 2020 22:32:04 GMT):
the vector seems to be storing this in little endian order (as is normal), but the IntType reads the memory in big endian order

KiChjang (Fri, 11 Sep 2020 22:32:04 GMT):
the vector seems to be storing this in big endian order, but the IntType reads the memory in little endian order

KiChjang (Fri, 11 Sep 2020 22:34:33 GMT):
so if i store a `hex"01020304"` bytes vector, casting the data pointer to an `i32` pointer would instead yield `hex"04030201"`

KiChjang (Fri, 11 Sep 2020 23:15:17 GMT):
oh, i found the `__beNtoleN` function, this could actually be useful

KiChjang (Sat, 12 Sep 2020 00:31:15 GMT):
it's done: https://github.com/hyperledger-labs/solang/pull/272

seanyoung (Sat, 12 Sep 2020 08:29:34 GMT):
@sbalikondwar so anything which has &'static lifetime cannot be the result of a function call.

seanyoung (Sat, 12 Sep 2020 08:30:11 GMT):
Unless you are working with `static` declarations or constant strings you don't want &'static

KiChjang (Sat, 12 Sep 2020 09:38:41 GMT):
actually this is quite interesting, in what cases do you see the need to use a &'static?

KiChjang (Sat, 12 Sep 2020 09:38:55 GMT):
it's most certainly a bug when it is being accepted as a parameter

seanyoung (Sat, 12 Sep 2020 10:45:19 GMT):
yes, I agree. It would be interesting to see what you are trying to do @sbalikondwar

seanyoung (Sat, 12 Sep 2020 10:45:38 GMT):
@KiChjang your PR looks great, thank you! I just need to go over it in detail but

seanyoung (Sat, 12 Sep 2020 10:45:38 GMT):
@KiChjang your PR looks great, thank you! I just need to go over it in detail

seanyoung (Sat, 12 Sep 2020 13:24:43 GMT):
@KiChjang thank you for your PR, looks great!

sbalikondwar (Sun, 13 Sep 2020 07:33:01 GMT):
yes so i have a option wrapped expression, when i am calling a function on that unwrapped value it requires explicit lifetime decleration

seanyoung (Sun, 13 Sep 2020 07:51:13 GMT):
Most likely you do not need 'static but something else like 'a

seanyoung (Sun, 13 Sep 2020 07:51:29 GMT):
can you give us the function declaration please?

sbalikondwar (Sun, 13 Sep 2020 07:57:23 GMT):
yes one min

sbalikondwar (Sun, 13 Sep 2020 07:57:51 GMT):
https://pastebin.com/6h7UYSin

sbalikondwar (Sun, 13 Sep 2020 07:58:38 GMT):
error is on line 35

sbalikondwar (Sun, 13 Sep 2020 07:59:11 GMT):
good afternoon

sbalikondwar (Sun, 13 Sep 2020 07:59:36 GMT):
i will be working today finishing the work to get hover working

sbalikondwar (Sun, 13 Sep 2020 08:02:25 GMT):
lookup_tbl: &mut Vec<(u64, u64, &str)> explicit lifetime required in the type of `lookup_tbl` lifetime `'static` requiredrustc(E0621) main.rs(414, 37): lifetime `'static` required

sbalikondwar (Sun, 13 Sep 2020 08:02:31 GMT):
is the error msg

sbalikondwar (Sun, 13 Sep 2020 08:02:48 GMT):
on line 35 in the pasted code

seanyoung (Sun, 13 Sep 2020 08:03:46 GMT):
good afternoon

seanyoung (Sun, 13 Sep 2020 08:05:27 GMT):
So the lookup table is `Vec<(u64, u64, &str)>`. This means that you are storing a reference to the string in the lookup table. This means that the rust compiler must know that the string object must live as long as the lookup table. Clearly it does not: `msg1` goes out of scope at line 37.

seanyoung (Sun, 13 Sep 2020 08:06:22 GMT):
The lookup table should be`Vec<(u64, u64, String)>`. This means that the `String` is stored in the table, not a reference to the string.

sbalikondwar (Sun, 13 Sep 2020 08:06:48 GMT):
yes you are right

sbalikondwar (Sun, 13 Sep 2020 08:08:39 GMT):
i should have looked on that

seanyoung (Sun, 13 Sep 2020 08:09:29 GMT):
lifetimes are hard

sbalikondwar (Sun, 13 Sep 2020 08:20:26 GMT):
true

sbalikondwar (Sun, 13 Sep 2020 08:38:10 GMT):
ok that fixed it thanks

sbalikondwar (Sun, 13 Sep 2020 19:48:19 GMT):
Today I finished the offset conversion and the algo for table generation

sbalikondwar (Sun, 13 Sep 2020 19:49:10 GMT):
Now changing hover to send back the respective message from server

sbalikondwar (Sun, 13 Sep 2020 19:49:10 GMT):
Now changing hover impl to send back the respective message from server

seanyoung (Sun, 13 Sep 2020 20:14:17 GMT):
That's great!

sbalikondwar (Mon, 14 Sep 2020 11:23:30 GMT):
good morning/afternoon

seanyoung (Mon, 14 Sep 2020 11:23:44 GMT):
good afternoon

sbalikondwar (Mon, 14 Sep 2020 11:24:08 GMT):
i looked on the hover impl, it seems to return strings to client but they are quite not matching offsets

sbalikondwar (Mon, 14 Sep 2020 11:24:27 GMT):
working on the offsets and values

sbalikondwar (Mon, 14 Sep 2020 15:12:55 GMT):
@seanyoung here in variable field https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L459 what is the use of the third val field ?

sbalikondwar (Mon, 14 Sep 2020 15:30:27 GMT):
how was the weekend

seanyoung (Mon, 14 Sep 2020 16:44:47 GMT):
the third field (the usize) is the variable number. You can use this to look it up in the symtable table: https://github.com/hyperledger-labs/solang/blob/master/src/sema/symtable.rs#L20

seanyoung (Mon, 14 Sep 2020 16:45:33 GMT):
the pt::Identifier loc will be where it was defined.

seanyoung (Mon, 14 Sep 2020 16:48:28 GMT):
weekend was ok, we saw some friends in on the common, to catch up. Not much else going on! I've worked on a new command line option --doc which generates some simple html for some solidity files. The idea is that this will eventually become something like godoc or rustdoc.

seanyoung (Mon, 14 Sep 2020 16:48:39 GMT):
how was your weekend?

sbalikondwar (Mon, 14 Sep 2020 17:14:45 GMT):
The docs feature sounds interesting!

seanyoung (Mon, 14 Sep 2020 17:15:06 GMT):
I'm not very good at html so looks awful at the moment.

seanyoung (Mon, 14 Sep 2020 17:15:46 GMT):
Also, it would be nice if there was a page per contract with a left side bar listing the functions

seanyoung (Mon, 14 Sep 2020 17:15:50 GMT):
but it's a start

sbalikondwar (Mon, 14 Sep 2020 17:18:30 GMT):
I was indoors this weekend, I went out with my friends he wanted a laptop for programming so we were on the lookout

sbalikondwar (Mon, 14 Sep 2020 17:18:30 GMT):
I was indoors this weekend, I went out with my friends, he wanted a laptop for programming so we were on the lookout

sbalikondwar (Mon, 14 Sep 2020 17:20:33 GMT):
I have spent years programming but never found a good laptop that can be used for everytask

sbalikondwar (Mon, 14 Sep 2020 17:21:37 GMT):
I guess all core programmers are bad at HTML :laughing:

sbalikondwar (Mon, 14 Sep 2020 17:21:37 GMT):
I guess all core programmers are bad at HTML :laughing: , including me

seanyoung (Mon, 14 Sep 2020 17:22:23 GMT):
I get a bit bored doing html :laughing:

sbalikondwar (Mon, 14 Sep 2020 17:22:28 GMT):
@seanyoung when do you get lunch

seanyoung (Mon, 14 Sep 2020 17:22:42 GMT):
I'm about to have dinner

sbalikondwar (Mon, 14 Sep 2020 17:22:58 GMT):
dinner! so early?

seanyoung (Mon, 14 Sep 2020 17:23:07 GMT):
well it's 18:23 here

sbalikondwar (Mon, 14 Sep 2020 17:23:15 GMT):
I had it like an hour ago

seanyoung (Mon, 14 Sep 2020 17:24:04 GMT):
so I would have lunch between 1pm and 2pm, so about the same time as you?

sbalikondwar (Mon, 14 Sep 2020 17:24:04 GMT):
then don't people feel hungry after 10 if they have dinner at 7 ?

sbalikondwar (Mon, 14 Sep 2020 17:24:41 GMT):
I usually have dinner from 2-3:30 (range) and dinner at 9-10

sbalikondwar (Mon, 14 Sep 2020 17:24:41 GMT):
I usually have lunch from 2-3:30 (range) and dinner at 9-10

sbalikondwar (Mon, 14 Sep 2020 17:26:18 GMT):
Also i tried out this game this weekend https://fallguys.com/

sbalikondwar (Mon, 14 Sep 2020 17:26:29 GMT):
its good

sbalikondwar (Mon, 14 Sep 2020 17:27:28 GMT):
I will be logging off in some time for today

sbalikondwar (Mon, 14 Sep 2020 17:27:49 GMT):
I will look on the usize value in Variable thanks

sbalikondwar (Mon, 14 Sep 2020 17:28:33 GMT):
Enjoy your meal @seanyoung , see you tomorrow

sbalikondwar (Mon, 14 Sep 2020 17:28:33 GMT):
Enjoy your meal @seanyoung good day, see you tomorrow

sbalikondwar (Tue, 15 Sep 2020 07:41:40 GMT):
good morning

sbalikondwar (Tue, 15 Sep 2020 07:42:23 GMT):
so i was looking into the ast file but i couldn't find how the values are assigned to the variables

sbalikondwar (Tue, 15 Sep 2020 07:42:30 GMT):
can you help me there

sbalikondwar (Tue, 15 Sep 2020 08:24:07 GMT):
ok i think the val is stored here https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L461

sbalikondwar (Tue, 15 Sep 2020 08:33:58 GMT):
in the same there is loc, typ, val1 ,val2of usize i am not sure what the val1,2 depict

seanyoung (Tue, 15 Sep 2020 09:08:33 GMT):
Expression::StorageVariable() for a contract storage variable (like Expression::Variable()).

seanyoung (Tue, 15 Sep 2020 09:08:37 GMT):
good morning

seanyoung (Tue, 15 Sep 2020 09:11:30 GMT):
if you have for example: ``` function f() public { int a; a = 102; } ``` Then this function will have two statements: Statement::VariableDecl() which declares the int a, and Statement::Expression() which will have an expression. This expression is Expression::Assign() which contains Expression::Variable() for left, and Expression::NumberLiteral() on the right.

sbalikondwar (Tue, 15 Sep 2020 10:24:38 GMT):
oh that's quite logical, I thought it other way sort of table like

sbalikondwar (Tue, 15 Sep 2020 10:41:00 GMT):
yes i can extract the values now!

seanyoung (Tue, 15 Sep 2020 10:50:03 GMT):
Wonderful! I've been looking forward to this

seanyoung (Tue, 15 Sep 2020 10:57:50 GMT):
that's great

sbalikondwar (Tue, 15 Sep 2020 11:07:06 GMT):
@seanyoung what if we have

sbalikondwar (Tue, 15 Sep 2020 11:07:14 GMT):
function f() public { int a; a = 102; }

sbalikondwar (Tue, 15 Sep 2020 11:07:14 GMT):
function f() public { int a; int b; a = 102; b = 12; a = a + b; }

sbalikondwar (Tue, 15 Sep 2020 11:07:47 GMT):
then the last a = a + b;

sbalikondwar (Tue, 15 Sep 2020 11:07:54 GMT):
how is that evaluated

sbalikondwar (Tue, 15 Sep 2020 11:08:21 GMT):
i know that a + b will be a int but will it also a num literal ?

seanyoung (Tue, 15 Sep 2020 11:14:46 GMT):
a + b will be an Expression::Add()

seanyoung (Tue, 15 Sep 2020 11:15:23 GMT):
a num literal is only if its just literally numbers

sbalikondwar (Tue, 15 Sep 2020 11:16:14 GMT):
so how will compiler store value of a after a= a + b

sbalikondwar (Tue, 15 Sep 2020 11:16:22 GMT):
in the namespace

seanyoung (Tue, 15 Sep 2020 11:18:22 GMT):
a= a + b will be: Expression::Assign The left of assign will be Expression::Variable(id of variable a) The right of assign will be Expression::Add The left of Add will be: Expression::Variable(id of variable a) The right of add will be Expression::Variable(id of variable b)

seanyoung (Tue, 15 Sep 2020 11:19:10 GMT):
The ast/namespace does not compute anything, it is just a tree of how it is parsed

sbalikondwar (Tue, 15 Sep 2020 11:20:33 GMT):
so lets say we have function f() public { int a; int b; a = 102; b = 12; a = a + b; }

sbalikondwar (Tue, 15 Sep 2020 11:21:13 GMT):
now if i hover over a (which on left side of +) it should show 102 and 12 for b

sbalikondwar (Tue, 15 Sep 2020 11:21:31 GMT):
but i wont know the value of a at the left side of =

seanyoung (Tue, 15 Sep 2020 11:22:01 GMT):
in the ast you don't know the values of variables, just the types

sbalikondwar (Tue, 15 Sep 2020 11:22:03 GMT):
so a(not known) = a (over 102) + b (hover 12)

sbalikondwar (Tue, 15 Sep 2020 11:22:29 GMT):
well i have thought to store values of vars

seanyoung (Tue, 15 Sep 2020 11:22:29 GMT):
maybe you can show the value if the variable is a constant, but no need to show the value of variables

seanyoung (Tue, 15 Sep 2020 11:23:08 GMT):
when a is assigned a value, you may not know the value a. For example `a = block.number;`

seanyoung (Tue, 15 Sep 2020 11:23:21 GMT):
well you cannot know the block number ahead of time

sbalikondwar (Tue, 15 Sep 2020 11:23:50 GMT):
yes you are right the value might only be known after compilation

seanyoung (Tue, 15 Sep 2020 11:23:54 GMT):
you can say variable a is of type X and it is defined there

seanyoung (Tue, 15 Sep 2020 11:24:16 GMT):
well, even after complication block.number is unknown, that is only known once it runs on the chain

sbalikondwar (Tue, 15 Sep 2020 11:24:39 GMT):
oh ok that i can show in the hover

sbalikondwar (Tue, 15 Sep 2020 11:24:51 GMT):
i understood

sbalikondwar (Wed, 16 Sep 2020 10:38:54 GMT):
good morning/afternoon

sbalikondwar (Wed, 16 Sep 2020 11:11:27 GMT):
we got meet in 20 min

sbalikondwar (Wed, 16 Sep 2020 11:31:02 GMT):
@seanyoung are you busy?

seanyoung (Wed, 16 Sep 2020 11:31:49 GMT):
Sorry!

seanyoung (Wed, 16 Sep 2020 11:32:03 GMT):
joining now

sbalikondwar (Wed, 16 Sep 2020 11:32:10 GMT):
ok no problem

sbalikondwar (Wed, 16 Sep 2020 11:35:04 GMT):

Screenshot from 2020-09-16 16-12-29.png

sbalikondwar (Wed, 16 Sep 2020 11:35:06 GMT):

Screenshot from 2020-09-16 16-19-05.png

sbalikondwar (Wed, 16 Sep 2020 11:35:07 GMT):

Screenshot from 2020-09-16 16-32-37.png

sbalikondwar (Wed, 16 Sep 2020 11:35:08 GMT):

Screenshot from 2020-09-16 16-32-49.png

sbalikondwar (Wed, 16 Sep 2020 11:35:09 GMT):

Screenshot from 2020-09-16 16-36-33.png

sbalikondwar (Thu, 17 Sep 2020 13:37:50 GMT):
good afternoon

sbalikondwar (Thu, 17 Sep 2020 13:38:07 GMT):
today had some work, joined in late

seanyoung (Thu, 17 Sep 2020 13:43:21 GMT):
good afternoon

seanyoung (Thu, 17 Sep 2020 14:09:12 GMT):
tsc call is now

sbalikondwar (Thu, 17 Sep 2020 14:11:59 GMT):
On which platform

sbalikondwar (Thu, 17 Sep 2020 14:12:05 GMT):
Can you the drop the link please

seanyoung (Thu, 17 Sep 2020 14:12:53 GMT):
https://zoom.us/my/hyperledger.community.backup

seanyoung (Thu, 17 Sep 2020 14:13:00 GMT):
now discussing semver vs callver

sbalikondwar (Thu, 17 Sep 2020 14:15:09 GMT):
ok joined in :thumbsup:

seanyoung (Thu, 17 Sep 2020 14:15:24 GMT):
:thumbsup:

sbalikondwar (Fri, 18 Sep 2020 12:08:35 GMT):
Good afternoon

seanyoung (Fri, 18 Sep 2020 13:18:30 GMT):
Good afternoon

sbalikondwar (Mon, 21 Sep 2020 08:45:07 GMT):
good morning

sbalikondwar (Mon, 21 Sep 2020 08:45:45 GMT):
it seems that i was indeed having same index ranges for different tokens which resulted in mismatches of the messages

sbalikondwar (Mon, 21 Sep 2020 08:46:07 GMT):
working on the issue

seanyoung (Mon, 21 Sep 2020 09:09:18 GMT):
good morning

seanyoung (Mon, 21 Sep 2020 09:10:07 GMT):
it might be worthwhile to only add one type of expression and make sure that works (like Expression::Variable). Then you should not have any overlap; other expressions can be added later.

sbalikondwar (Mon, 21 Sep 2020 14:17:08 GMT):
yes that will be useful

sbalikondwar (Mon, 21 Sep 2020 14:17:40 GMT):
do you have lockdown reimplemented? I just heard in news that cases are increasing a lot

seanyoung (Mon, 21 Sep 2020 15:00:50 GMT):
Cases are increasing a lot. There is much talk of a new lockdown, but nothing has been decided yet.

seanyoung (Mon, 21 Sep 2020 15:01:02 GMT):
How are things for you?

sbalikondwar (Mon, 21 Sep 2020 15:02:59 GMT):
the increasing rate seems to have normalised, so i think everything is under control herre

sbalikondwar (Mon, 21 Sep 2020 15:02:59 GMT):
the increasing rate seems to have normalised, so i think everything is under control here

sbalikondwar (Mon, 21 Sep 2020 15:02:59 GMT):
the cases rate seems to have normalised, so i think everything is under control here

sbalikondwar (Mon, 21 Sep 2020 15:44:43 GMT):
@seanyoung for past few days i have been wondering how strings are concatinated in rust?

sbalikondwar (Mon, 21 Sep 2020 15:44:54 GMT):
to my surprise the answer is very strange

seanyoung (Mon, 21 Sep 2020 15:51:35 GMT):
I got an email about you asking about string concatenation in #solang, is the message deleted or not just coming through for me?

sbalikondwar (Mon, 21 Sep 2020 15:54:11 GMT):
Yes I have a doubt in that

sbalikondwar (Mon, 21 Sep 2020 15:54:38 GMT):
the implementation seems like fn main() { let mut owned_string: String = "hello ".to_owned(); let borrowed_string: &str = "world"; owned_string.push_str(borrowed_string); println!("{}", owned_string); }

sbalikondwar (Mon, 21 Sep 2020 15:54:51 GMT):
but https://stackoverflow.com/questions/30154541/how-do-i-concatenate-strings

sbalikondwar (Mon, 21 Sep 2020 15:55:22 GMT):
except than owned impl is there any other method?

sbalikondwar (Mon, 21 Sep 2020 15:56:58 GMT):
but i got the answer in the link though

seanyoung (Mon, 21 Sep 2020 16:37:05 GMT):
`format!("{}{}", foo, bar);`

seanyoung (Mon, 21 Sep 2020 16:37:29 GMT):
you can only modify an owned string otherwise

sbalikondwar (Tue, 22 Sep 2020 09:18:00 GMT):
good afternoon/morning

sbalikondwar (Tue, 22 Sep 2020 09:18:18 GMT):
I fixed the offset errors,

sbalikondwar (Tue, 22 Sep 2020 09:18:39 GMT):

Screenshot from 2020-09-22 14-43-02.png

sbalikondwar (Tue, 22 Sep 2020 09:18:41 GMT):

Screenshot from 2020-09-22 14-43-08.png

sbalikondwar (Tue, 22 Sep 2020 09:18:41 GMT):

Screenshot from 2020-09-22 14-47-10.png

sbalikondwar (Tue, 22 Sep 2020 09:19:59 GMT):
So now i can confirm that the offsets are properly converted from line and chars followed with proper identification of the var types

sbalikondwar (Tue, 22 Sep 2020 09:20:32 GMT):
and they are returned back to the client

sbalikondwar (Tue, 22 Sep 2020 09:20:50 GMT):
now i can follow up on working with functions, for loops messages

seanyoung (Tue, 22 Sep 2020 09:47:06 GMT):
Good morning That's great news!

sbalikondwar (Wed, 23 Sep 2020 10:36:05 GMT):
good afternoon

sbalikondwar (Wed, 23 Sep 2020 11:27:19 GMT):
we got meet in few minutes

seanyoung (Wed, 23 Sep 2020 11:28:52 GMT):
Good afternoon

sbalikondwar (Wed, 23 Sep 2020 11:29:21 GMT):
https://pastebin.com/Ujeh7uKq

seanyoung (Wed, 23 Sep 2020 12:05:03 GMT):
https://solang.readthedocs.io/en/latest/language.html#tags

seanyoung (Wed, 23 Sep 2020 12:07:06 GMT):
https://solang.readthedocs.io/en/latest/installing.html#installing-llvm-on-ubuntu

seanyoung (Wed, 23 Sep 2020 12:08:05 GMT):
https://solang.readthedocs.io/en/latest/installing.html#building-llvm-using-docker

sbalikondwar (Thu, 24 Sep 2020 12:12:28 GMT):
good afternoon

sbalikondwar (Thu, 24 Sep 2020 12:15:11 GMT):
is there any way there i can pass one function arg as dummy value, I mean like we have '_' is there anything similar

sbalikondwar (Thu, 24 Sep 2020 12:15:44 GMT):
lets say i have fn a(int b, int c) { //do something }

sbalikondwar (Thu, 24 Sep 2020 12:16:02 GMT):
but i dont use c in my function it is just passed

sbalikondwar (Thu, 24 Sep 2020 12:16:38 GMT):
so can i make some changes in the function call like a(b, _); to make the call work?

sbalikondwar (Thu, 24 Sep 2020 12:17:34 GMT):
one condition is i can't change function a and its no of args because it is almost 100 lines which call it

seanyoung (Thu, 24 Sep 2020 14:31:47 GMT):
Good afternoon If a function has an argument, you'll have to pass in a value for it. If you're not using an argument in a function, then it is better to remove the argument completely

sbalikondwar (Thu, 24 Sep 2020 14:39:13 GMT):
yeah, i solved

sbalikondwar (Fri, 25 Sep 2020 07:55:52 GMT):
good morning

sbalikondwar (Fri, 25 Sep 2020 07:56:07 GMT):
@seanyoung I am a bit confused on the function call fields here https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L515

sbalikondwar (Fri, 25 Sep 2020 07:56:35 GMT):
if you can explain me one with an example it'll be great

seanyoung (Fri, 25 Sep 2020 09:26:37 GMT):
good morning A function call can be to a function in the same contract, in a library or a base contract. So the contract where the function is defined is in `contract_no`. Then the `function_no` is the function number in that contract, _however_ is signature is `Some()` then the function call is a virtual call. This is calling a virtual call, in which functions can be overriden in another contract. In this case `function_no` should be ignored. Note that virtual calls are resolved at compile time, unlike C++ or other languages. This code shows how to get a reference to function which will be called: https://github.com/hyperledger-labs/solang/blob/master/src/sema/mutability.rs#L104-L112

seanyoung (Fri, 25 Sep 2020 09:27:13 GMT):
Clearly this enum needs documentation

sbalikondwar (Fri, 25 Sep 2020 15:28:45 GMT):
I am getting some function hovers here

sbalikondwar (Fri, 25 Sep 2020 15:28:58 GMT):

Screenshot from 2020-09-25 20-57-53.png

sbalikondwar (Fri, 25 Sep 2020 15:29:25 GMT):
i need to fix the messages though,

sbalikondwar (Fri, 25 Sep 2020 15:29:59 GMT):
I'll now properly format it with the tests

sbalikondwar (Fri, 25 Sep 2020 15:29:59 GMT):
I'll now properly format it with working on the tests

seanyoung (Fri, 25 Sep 2020 15:34:58 GMT):
nice!

sbalikondwar (Sun, 27 Sep 2020 14:38:31 GMT):
I finally updated my llvm

sbalikondwar (Sun, 27 Sep 2020 14:38:37 GMT):
hyperion@hyperion-rog:~$ llvm-config --version 10.0.0

seanyoung (Sun, 27 Sep 2020 15:12:46 GMT):
nice

sbalikondwar (Sun, 27 Sep 2020 16:14:52 GMT):
This is so cool https://youtu.be/HOOsK3Hjh1U

sbalikondwar (Sun, 27 Sep 2020 16:15:04 GMT):
A tram library

seanyoung (Sun, 27 Sep 2020 17:26:33 GMT):
That's a great idea!

sbalikondwar (Mon, 28 Sep 2020 06:45:48 GMT):
good morning

sbalikondwar (Mon, 28 Sep 2020 06:46:24 GMT):
in the weekend I did some clean up of the impl, adding comments, update and check on new solang

sbalikondwar (Mon, 28 Sep 2020 06:46:24 GMT):
in the weekend I did some clean up of the impl, adding comments, update and check on new solang version

sbalikondwar (Mon, 28 Sep 2020 06:46:58 GMT):
now i am working on the tests, but it seems that there is no direct function to test hovers.

seanyoung (Mon, 28 Sep 2020 08:06:34 GMT):
good morning

seanyoung (Mon, 28 Sep 2020 08:10:16 GMT):
Is there a language server client in rust?

sbalikondwar (Mon, 28 Sep 2020 09:07:44 GMT):
no, the clients are supposed to be in js cause vscode is written in js and it runs only js in it

seanyoung (Mon, 28 Sep 2020 09:34:53 GMT):
Ok. I was thinking of a way of being able to run a test

sbalikondwar (Mon, 28 Sep 2020 09:37:38 GMT):
I am looking into some options that i can find over vscode issues section of vscode repo

sbalikondwar (Mon, 28 Sep 2020 12:31:09 GMT):
looks like the API to test hover is not yet implemented (atleast when we have server and client in different languages)

seanyoung (Mon, 28 Sep 2020 12:43:58 GMT):
ok. Well, we can test manually for now

sbalikondwar (Mon, 28 Sep 2020 12:56:59 GMT):
yeah, well i will try for some more time and will open a PR after (sometime later today)

seanyoung (Mon, 28 Sep 2020 13:17:29 GMT):
Great!

sbalikondwar (Mon, 28 Sep 2020 15:09:49 GMT):
good news

sbalikondwar (Mon, 28 Sep 2020 15:10:12 GMT):
i found hover test implementation and now have completed the tests

sbalikondwar (Mon, 28 Sep 2020 15:12:48 GMT):

Screenshot from 2020-09-28 20-42-35.png

seanyoung (Mon, 28 Sep 2020 15:27:59 GMT):
Perfect!

sbalikondwar (Mon, 28 Sep 2020 16:03:44 GMT):
ok so took care of clippy everything is ready

sbalikondwar (Mon, 28 Sep 2020 16:04:02 GMT):
will make some doc for this feature and push it

sbalikondwar (Mon, 28 Sep 2020 16:04:26 GMT):
just a reminder i depreciated the function feature cause it had some unnecessary complications

sbalikondwar (Mon, 28 Sep 2020 16:04:39 GMT):
i will add it after we atleast merge the variable one

sbalikondwar (Mon, 28 Sep 2020 19:08:33 GMT):
on the build-bots i have some problem

sbalikondwar (Mon, 28 Sep 2020 19:09:08 GMT):
there seems to be conflict with 10 version llvm

sbalikondwar (Mon, 28 Sep 2020 19:09:25 GMT):
483 | / std::compile_error!(concat!( 484 | | "No suitable version of LLVM was found system-wide or pointed 485 | | to by LLVM_SYS_", env!("CARGO_PKG_VERSION_MAJOR"), "_PREFIX. 486 | | ... | 490 | | llvm-sys: https://crates.io/crates/llvm-sys 491 | | llvmenv: https://crates.io/crates/llvmenv")); | |____________________________________________________^ error: aborting due to previous error error: could not compile `llvm-sys`. To learn more, run the command again with --verbose. warning: build failed, waiting for other jobs to finish... error: build failed

sbalikondwar (Mon, 28 Sep 2020 19:57:49 GMT):
https://github.com/Hyperion101010/sls/runs/1178330595?check_suite_focus=true , the cargo build gives some issues

sbalikondwar (Mon, 28 Sep 2020 20:00:25 GMT):
the current work sits at https://github.com/Hyperion101010/sls/tree/phase-3

sbalikondwar (Mon, 28 Sep 2020 20:00:42 GMT):
i am looking into the ci build issue

sbalikondwar (Mon, 28 Sep 2020 20:11:33 GMT):
logging off for today

sbalikondwar (Mon, 28 Sep 2020 20:11:41 GMT):
see you tomorrow good day

seanyoung (Mon, 28 Sep 2020 20:54:23 GMT):
Hi, sorry I was busy. So it looks like there is no llvm-10 installed in the `ubuntu-latest` image on github. You can install it using github actions: `sudo apt install curl llvm-10-dev clang-10`

seanyoung (Mon, 28 Sep 2020 20:56:45 GMT):
Alternatively you can use the solang ci, but I don't know if that has the necessary node things. See: https://github.com/hyperledger-labs/solang/blob/master/.github/workflows/test.yml#L7

sbalikondwar (Tue, 29 Sep 2020 07:21:51 GMT):
good morning

sbalikondwar (Tue, 29 Sep 2020 07:22:00 GMT):
i have fixed the issue over ci

sbalikondwar (Tue, 29 Sep 2020 07:22:22 GMT):
the github seems to be down for some time hence my jobs are queued

seanyoung (Tue, 29 Sep 2020 07:38:55 GMT):
good morning

seanyoung (Tue, 29 Sep 2020 07:39:11 GMT):
There seem to be some failures: https://github.com/Hyperion101010/sls/runs/1180651398?check_suite_focus=true#step:5:52

sbalikondwar (Tue, 29 Sep 2020 07:45:11 GMT):
yes i reported it before, so the thing is when we are running interactive tests on the ci it behaves very differently than on the PC.

sbalikondwar (Tue, 29 Sep 2020 07:46:37 GMT):
So when we see the tests fail, it doesn't mean they are failing but the thing is on the ci the response from server to the client seem to be take irregular delays which result in undefined values

sbalikondwar (Tue, 29 Sep 2020 07:47:44 GMT):
I have looked into other vscode extension repos and they seem to defer from performing interactive tests(atleast when the client and server is in different languages)

seanyoung (Tue, 29 Sep 2020 07:48:07 GMT):
So if the CI tests are useless, would be possible to open a PR on solang-vscode so I can do a review please?

sbalikondwar (Tue, 29 Sep 2020 07:49:06 GMT):
Sure, well CI tests are not completely useless but only the interactive once , the build operations for the extension is useful

sbalikondwar (Tue, 29 Sep 2020 07:49:12 GMT):
i am opening a PR

seanyoung (Tue, 29 Sep 2020 07:49:49 GMT):
thanks

sbalikondwar (Tue, 29 Sep 2020 08:08:19 GMT):
https://github.com/hyperledger-labs/solang-vscode/pull/9

sbalikondwar (Tue, 29 Sep 2020 08:08:29 GMT):
one test seems to be running forever

sbalikondwar (Tue, 29 Sep 2020 08:14:46 GMT):
https://github.com/hyperledger-labs/solang-vscode/pull/9/checks?check_run_id=1180853832

sbalikondwar (Tue, 29 Sep 2020 08:15:01 GMT):
its over 22 mins

sbalikondwar (Tue, 29 Sep 2020 09:14:55 GMT):
@seanyoung is it possible for you stop and rerun the jobs?

sbalikondwar (Tue, 29 Sep 2020 09:15:03 GMT):
else i will just remove the tests

sbalikondwar (Tue, 29 Sep 2020 09:15:30 GMT):
cause they aren't of that uses on ci.yml

seanyoung (Tue, 29 Sep 2020 09:16:50 GMT):
I have a button "cancel workflow". Usually jobs time out after 10 minutes (if I remember that correctly). I suspect this is temporary issue with github, but I don't know.

sbalikondwar (Tue, 29 Sep 2020 09:17:16 GMT):
that can be a case

sbalikondwar (Tue, 29 Sep 2020 09:17:36 GMT):
of the github, cause i also had some jobs queued for no reason

sbalikondwar (Tue, 29 Sep 2020 09:19:56 GMT):
if you can please cancel workflow, and try rerunning once

sbalikondwar (Tue, 29 Sep 2020 09:20:15 GMT):
if it shows similar behaviour i will remove the tests

sbalikondwar (Tue, 29 Sep 2020 09:20:15 GMT):
if it shows similar behaviour i will remove the ci tests

seanyoung (Tue, 29 Sep 2020 09:35:36 GMT):
cancelled

sbalikondwar (Tue, 29 Sep 2020 09:37:21 GMT):
will you be re-running it?

sbalikondwar (Tue, 29 Sep 2020 09:37:40 GMT):
i think the action options are on the reviewer

seanyoung (Tue, 29 Sep 2020 09:39:44 GMT):
so with github you can only restart all jobs

sbalikondwar (Tue, 29 Sep 2020 09:40:47 GMT):
i have only this option

sbalikondwar (Tue, 29 Sep 2020 09:40:58 GMT):

Screenshot from 2020-09-29 15-10-35.png

seanyoung (Tue, 29 Sep 2020 09:41:09 GMT):
I've restarted them

sbalikondwar (Tue, 29 Sep 2020 09:41:17 GMT):
thanks

sbalikondwar (Tue, 29 Sep 2020 09:45:42 GMT):
i think the macos test weren't ran

seanyoung (Tue, 29 Sep 2020 09:51:57 GMT):
I think they've restarted now

seanyoung (Tue, 29 Sep 2020 09:52:18 GMT):
This is the first time I've run the hoover-over on my machine -- very nice!

seanyoung (Tue, 29 Sep 2020 09:54:25 GMT):
I think there are some minor issues around function arguments/returns, and if you hoover over e.g. a '{' . But I this is a great start

seanyoung (Tue, 29 Sep 2020 09:55:09 GMT):
Let me do a review of the code later today

sbalikondwar (Tue, 29 Sep 2020 09:55:16 GMT):
sure

sbalikondwar (Tue, 29 Sep 2020 09:55:52 GMT):
I am glad

sbalikondwar (Tue, 29 Sep 2020 09:56:29 GMT):
Yes the function args/returns sometimes fail

sbalikondwar (Tue, 29 Sep 2020 09:56:51 GMT):
but that is possible if the code has some errors

sbalikondwar (Tue, 29 Sep 2020 09:57:09 GMT):
so at that time the namespace is not properly constructed followed by lookup table

sbalikondwar (Tue, 29 Sep 2020 09:58:01 GMT):
sure, anytime you are comfortable let me know when you are done

seanyoung (Tue, 29 Sep 2020 11:56:55 GMT):
Sorry I've had a busy day.

seanyoung (Tue, 29 Sep 2020 12:47:10 GMT):
I've added some review comments. It's up to you if you want to them now or for phase-4.

seanyoung (Tue, 29 Sep 2020 12:47:21 GMT):
Let's discuss phase-4 tomorrow

sbalikondwar (Tue, 29 Sep 2020 15:25:49 GMT):
i fixed most of the requests but have doubt on emit and builtin

sbalikondwar (Tue, 29 Sep 2020 15:25:58 GMT):
comments on the PR

sbalikondwar (Tue, 29 Sep 2020 15:26:04 GMT):
can you elaborate them more

sbalikondwar (Tue, 29 Sep 2020 15:26:32 GMT):
in emit there is no way to extract Foo of emit Foo(arg1)'

sbalikondwar (Tue, 29 Sep 2020 15:26:32 GMT):
in emit there is no way to extract Foo of emit 'Foo(arg1)'

seanyoung (Tue, 29 Sep 2020 17:48:10 GMT):
You're right, there is no way to extract Foo from `emit Foo()`

seanyoung (Tue, 29 Sep 2020 17:48:43 GMT):
This is a problem for all types. :/

seanyoung (Tue, 29 Sep 2020 17:49:48 GMT):
Builtin is stuff like `tx.gasprice`, `block.number`, or the function `gasleft()`. Solang should be providing documentation for them.

sbalikondwar (Tue, 29 Sep 2020 17:52:45 GMT):
Can I put this for next eval

sbalikondwar (Tue, 29 Sep 2020 17:53:16 GMT):
Others I have fixed up

sbalikondwar (Tue, 29 Sep 2020 17:53:16 GMT):
Others review issues I have fixed up

sbalikondwar (Tue, 29 Sep 2020 17:53:57 GMT):
Cause it'll be easy to add it up while implementing function feature

seanyoung (Tue, 29 Sep 2020 19:52:26 GMT):
of course, this will need some thinking through

seanyoung (Tue, 29 Sep 2020 19:52:37 GMT):
yes, please can you push your changes

sbalikondwar (Wed, 30 Sep 2020 07:48:04 GMT):
@seanyoung ready for review

sbalikondwar (Wed, 30 Sep 2020 07:48:24 GMT):
https://github.com/hyperledger-labs/solang-vscode/pull/9

seanyoung (Wed, 30 Sep 2020 08:53:54 GMT):
I think it looks good, there are some minor details to fix but that's ok.

seanyoung (Wed, 30 Sep 2020 08:57:41 GMT):
ok, merged. Let's talk about phase-4 later during our call

sbalikondwar (Wed, 30 Sep 2020 10:03:39 GMT):
thanks! thinking on the points for eval 4

sbalikondwar (Thu, 01 Oct 2020 09:51:35 GMT):
good morning

seanyoung (Thu, 01 Oct 2020 10:19:59 GMT):
good morning

seanyoung (Thu, 01 Oct 2020 10:24:25 GMT):
I wrote a list of things that can be improved in solang on a piece of paper. I'll send them later today

seanyoung (Thu, 01 Oct 2020 10:26:39 GMT):
Also, I was thinking that struct members should need hover, like `uint32 x = foo.bar;`. In this case "foo" needs a hover saying "this is struct of type X with fields Y,Z" and "bar" needs a hover saying "field Z of struct X". Array indexes would also be good, e.g. `uint32 x = foo[i];`

seanyoung (Thu, 01 Oct 2020 10:26:44 GMT):
anyway all details

sbalikondwar (Thu, 01 Oct 2020 10:27:51 GMT):
Yeah you are right

sbalikondwar (Thu, 01 Oct 2020 10:28:05 GMT):
Will add it on the list

sbalikondwar (Thu, 01 Oct 2020 10:28:17 GMT):
I shall update it later today

manoranjith (Fri, 02 Oct 2020 06:23:16 GMT):
Has joined the channel.

sbalikondwar (Fri, 02 Oct 2020 07:37:33 GMT):
@seanyoung I have updated the project plan https://wiki.hyperledger.org/pages/viewpage.action?pageId=31202927

seanyoung (Fri, 02 Oct 2020 08:41:06 GMT):
Looks good, thanks @sbalikondwar

seanyoung (Fri, 02 Oct 2020 10:51:10 GMT):
Solang will be used with the Plasm Network: https://medium.com/stake-technologies/plasm-unveils-the-vision-of-multi-vms-scalable-smart-contract-platform-on-polkadot-and-its-tvl-for-da2e96fd6cf4

sbalikondwar (Mon, 05 Oct 2020 07:54:19 GMT):
good afternoon/morning

seanyoung (Mon, 05 Oct 2020 09:03:43 GMT):
good afternoon

seanyoung (Mon, 05 Oct 2020 09:03:51 GMT):
How are you getting on?

sbalikondwar (Mon, 05 Oct 2020 09:50:20 GMT):
Starting off with functions

sbalikondwar (Mon, 05 Oct 2020 09:50:42 GMT):
Construction respective messages

seanyoung (Mon, 05 Oct 2020 10:04:38 GMT):
I've added type location tracking to the ast here https://github.com/hyperledger-labs/solang/pull/288

sbalikondwar (Mon, 05 Oct 2020 13:44:34 GMT):
seems like that was quite an effort

sbalikondwar (Mon, 05 Oct 2020 19:28:02 GMT):
Logging off for today see you

sbalikondwar (Mon, 05 Oct 2020 19:28:06 GMT):
Good night

seanyoung (Mon, 05 Oct 2020 20:19:38 GMT):
good night

sbalikondwar (Tue, 06 Oct 2020 13:53:58 GMT):
Good afternoon

seanyoung (Tue, 06 Oct 2020 14:46:15 GMT):
Good afternoon

sbalikondwar (Tue, 06 Oct 2020 15:31:09 GMT):
i am tackling function type by first creating messages when we have a function definition, retreiving that message when we get a functioncall

sbalikondwar (Wed, 07 Oct 2020 08:54:15 GMT):
good morning

seanyoung (Wed, 07 Oct 2020 09:05:27 GMT):
Good afternoon

sbalikondwar (Wed, 07 Oct 2020 11:29:07 GMT):
meet time

sbalikondwar (Wed, 07 Oct 2020 11:29:23 GMT):
@seanyoung

sbalikondwar (Wed, 07 Oct 2020 11:31:28 GMT):
fn traverse(ns: &ast::Namespace, lookup_tbl: &mut Vec<(u64, u64, String)>, fnc_map: &mut HashMap) { for contrct in &ns.contracts { for fnc in &contrct.functions { let fnc_msg_type = Backend::construct_fnc(&fnc.ty); let mut param_msg = format!("param-msg {} {}(", fnc_msg_type, fnc.name); for parm in &fnc.params { let msg = format!("{}:{}, ", parm.name ,parm.ty.to_string(ns)); param_msg = format!("{} {}", param_msg, msg); } param_msg = format!("{} ) returns (", param_msg); for ret in &fnc.returns { let msg = format!("{}:{}, ", ret.name, ret.ty.to_string(ns)); param_msg = format!("{} {}", param_msg, msg); } param_msg = format!("{})", param_msg); //lookup_tbl.push((fnc.loc.1 as u64, fnc.loc.1 as u64, param_msg)); let fnc_sig = format!("{}{}", fnc.name, fnc.signature); fnc_map.insert(fnc_sig, param_msg); for stmt in &fnc.body { Backend::construct_stmt(&stmt, lookup_tbl, &fnc.symtable,fnc_map, ns); } }

sbalikondwar (Wed, 07 Oct 2020 11:32:10 GMT):
let fnc_nam = &ns.contracts[*contract_no].functions[*function_no].name; if let Some(sig_nm) = signature { let fnc_ky = format!("{}{}", fnc_nam, sig_nm); if fnc_map.contains_key(&fnc_ky) { match fnc_map.get(&fnc_ky) { Some(ans) => { lookup_tbl.push((loc.1 as u64, loc.2 as u64, ans[..].to_string())); } _ => {} } } else { lookup_tbl.push((loc.1 as u64, loc.2 as u64, fnc_ky)); } }

sbalikondwar (Wed, 07 Oct 2020 11:32:10 GMT):
////////let fnc_nam = &ns.contracts[*contract_no].functions[*function_no].name; if let Some(sig_nm) = signature { let fnc_ky = format!("{}{}", fnc_nam, sig_nm); if fnc_map.contains_key(&fnc_ky) { match fnc_map.get(&fnc_ky) { Some(ans) => { lookup_tbl.push((loc.1 as u64, loc.2 as u64, ans[..].to_string())); } _ => {} } } else { lookup_tbl.push((loc.1 as u64, loc.2 as u64, fnc_ky)); } }

sbalikondwar (Wed, 07 Oct 2020 11:34:46 GMT):
let fnc_sig = format!("{}{}", fnc.name, fnc.signature);

seanyoung (Wed, 07 Oct 2020 11:38:40 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/tags.rs#L149

seanyoung (Wed, 07 Oct 2020 11:39:40 GMT):
https://solang.readthedocs.io/en/latest/language.html#tags

sbalikondwar (Thu, 08 Oct 2020 07:42:39 GMT):
i got the function messages working along with return types

sbalikondwar (Thu, 08 Oct 2020 07:42:59 GMT):

Screenshot from 2020-10-08 13-11-37.png

sbalikondwar (Thu, 08 Oct 2020 07:42:59 GMT):

Screenshot from 2020-10-08 13-12-03.png

sbalikondwar (Thu, 08 Oct 2020 07:43:00 GMT):

Screenshot from 2020-10-08 13-12-12.png

sbalikondwar (Thu, 08 Oct 2020 07:44:03 GMT):
good morning

sbalikondwar (Thu, 08 Oct 2020 07:46:42 GMT):
will add doc support

sbalikondwar (Thu, 08 Oct 2020 07:46:42 GMT):
will now add doc support

seanyoung (Thu, 08 Oct 2020 07:47:06 GMT):
good morning

seanyoung (Thu, 08 Oct 2020 07:47:22 GMT):
Looks great! The formatting can be slightly improved.

seanyoung (Thu, 08 Oct 2020 07:48:00 GMT):
function is lowercase and if there are no returns, then there should be no "returns ()"

sbalikondwar (Thu, 08 Oct 2020 07:48:41 GMT):
Yes correct, will fix those as well

sbalikondwar (Thu, 08 Oct 2020 19:44:45 GMT):
Logging off for today

sbalikondwar (Thu, 08 Oct 2020 19:44:47 GMT):
Good night

sbalikondwar (Sun, 11 Oct 2020 15:31:03 GMT):
good afternoon

sbalikondwar (Sun, 11 Oct 2020 15:31:19 GMT):
i was working a bit this weekend offline

sbalikondwar (Sun, 11 Oct 2020 15:33:52 GMT):

Screenshot from 2020-10-11 21-00-37.png

sbalikondwar (Sun, 11 Oct 2020 15:33:54 GMT):

Screenshot from 2020-10-11 21-03-35.png

sbalikondwar (Sun, 11 Oct 2020 15:34:21 GMT):
looks like the doc comments are coming in properly

sbalikondwar (Sun, 11 Oct 2020 15:34:29 GMT):
only it needs some proper spacing

sbalikondwar (Sun, 11 Oct 2020 15:34:43 GMT):
:relaxed:

sbalikondwar (Sun, 11 Oct 2020 15:34:43 GMT):
:smile:

sbalikondwar (Mon, 12 Oct 2020 07:46:27 GMT):
good morning

seanyoung (Mon, 12 Oct 2020 08:16:18 GMT):
Good afternoon

sbalikondwar (Mon, 12 Oct 2020 17:53:43 GMT):
Seems like lot of people have been removed from Hyperledger labs

sbalikondwar (Mon, 12 Oct 2020 17:55:44 GMT):
Did you got some mail like that through GitHub @seanyoung

sbalikondwar (Mon, 12 Oct 2020 17:55:55 GMT):
By the way how is the weather there

sbalikondwar (Mon, 12 Oct 2020 17:56:16 GMT):
I am working on the emit tokens and built-ins now

seanyoung (Mon, 12 Oct 2020 18:07:48 GMT):
I haven't seen anything about people getting removed from hyperledger labs

seanyoung (Mon, 12 Oct 2020 18:07:58 GMT):
Is your account still ok?

seanyoung (Mon, 12 Oct 2020 18:08:39 GMT):
Pretty cold and rainy here today 10C

sbalikondwar (Mon, 12 Oct 2020 18:17:13 GMT):
Yeah well it shouldn't be a problem Anyways we have rjones for that

sbalikondwar (Mon, 12 Oct 2020 18:17:46 GMT):
10C 🥶 how can someone survive

sbalikondwar (Mon, 12 Oct 2020 18:20:54 GMT):
It's raining here and there was a very violent thunder

sbalikondwar (Mon, 12 Oct 2020 18:27:02 GMT):
I hate winters!

seanyoung (Mon, 12 Oct 2020 18:58:48 GMT):
My cat is not happy about the weather. He's been moody all day!

seanyoung (Mon, 12 Oct 2020 18:59:28 GMT):
Somehow I've been removed from hyperledger on github. I don't know what is going on.

sbalikondwar (Mon, 12 Oct 2020 19:09:54 GMT):
I think rjones had to make some changes

sbalikondwar (Mon, 12 Oct 2020 19:10:07 GMT):
While updating the repos

sbalikondwar (Mon, 12 Oct 2020 19:10:19 GMT):
And webstie on Hyperledger labs

sbalikondwar (Mon, 12 Oct 2020 19:11:39 GMT):
Let's see, well I am off to sleep for now See you tomorrow good afternoon

sbalikondwar (Mon, 12 Oct 2020 19:11:39 GMT):
Let's see, well I am off to sleep for now See you tomorrow good evening

seanyoung (Mon, 12 Oct 2020 19:14:38 GMT):
See you tomorrow

sbalikondwar (Tue, 13 Oct 2020 10:50:07 GMT):
good morning

sbalikondwar (Tue, 13 Oct 2020 10:55:45 GMT):
@seanyoung what should be the hover for emit tokens ?

sbalikondwar (Tue, 13 Oct 2020 10:56:14 GMT):
emit Deposit(msg.sender, _id, msg.value);

sbalikondwar (Tue, 13 Oct 2020 10:56:23 GMT):
event Deposit( address indexed _from, bytes32 indexed _id, uint _value ); function deposit(bytes32 _id) public payable { // Events are emitted using `emit`, followed by // the name of the event and the arguments // (if any) in parentheses. Any such invocation // (even deeply nested) can be detected from // the JavaScript API by filtering for `Deposit`. emit Deposit(msg.sender, _id, msg.value); }

seanyoung (Tue, 13 Oct 2020 11:33:18 GMT):
I think that the hover for `Deposit` should show the event, like: ``` event Deposit( address indexed _from, bytes32 indexed _id, uint _value ); ```

seanyoung (Tue, 13 Oct 2020 11:34:10 GMT):
The expressions msg.sender, _id, and msg.value should have their own hover. The first and last are builtins

sbalikondwar (Tue, 13 Oct 2020 12:16:06 GMT):
yes, i understood

sbalikondwar (Tue, 13 Oct 2020 12:16:23 GMT):
did some reading on the same from solidity docs

sbalikondwar (Wed, 14 Oct 2020 10:20:15 GMT):
good afternoon

seanyoung (Wed, 14 Oct 2020 10:58:42 GMT):
good afternoon

sbalikondwar (Wed, 14 Oct 2020 11:30:33 GMT):
time to meet

sbalikondwar (Wed, 14 Oct 2020 11:37:04 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L807

sbalikondwar (Wed, 14 Oct 2020 11:37:39 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L518

sbalikondwar (Wed, 14 Oct 2020 11:43:47 GMT):
contract ClientReceipt { event Deposit( address indexed _from, bytes32 indexed _id, uint _value ); function deposit(bytes32 _id) public payable { // Events are emitted using `emit`, followed by // the name of the event and the arguments // (if any) in parentheses. Any such invocation // (even deeply nested) can be detected from // the JavaScript API by filtering for `Deposit`. emit Deposit(msg.sender, _id, msg.value); } }

seanyoung (Wed, 14 Oct 2020 11:45:05 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/builtin.rs#L273-LL280

seanyoung (Wed, 14 Oct 2020 11:55:12 GMT):
https://sub0.parity.io/?utm_source=substratedev&utm_medium=referral&utm_campaign=sub0&utm_term=parity

seanyoung (Wed, 14 Oct 2020 11:58:09 GMT):
https://solana.com/

sbalikondwar (Thu, 15 Oct 2020 11:32:36 GMT):
good afternoon

seanyoung (Thu, 15 Oct 2020 11:33:52 GMT):
good afternoon

sbalikondwar (Thu, 15 Oct 2020 12:27:46 GMT):
emit event hovers are also working

sbalikondwar (Thu, 15 Oct 2020 12:27:58 GMT):

Screenshot from 2020-10-15 17-56-46.png

sbalikondwar (Thu, 15 Oct 2020 12:27:59 GMT):

Screenshot from 2020-10-15 17-57-24.png

sbalikondwar (Thu, 15 Oct 2020 12:28:25 GMT):
there is some formatting needed

sbalikondwar (Thu, 15 Oct 2020 12:28:48 GMT):
now i will look on the schedule of the conference and see if something is interesting

sbalikondwar (Fri, 16 Oct 2020 07:19:34 GMT):
good morning

sbalikondwar (Fri, 16 Oct 2020 07:29:35 GMT):
now i will look into the builtins

sbalikondwar (Fri, 16 Oct 2020 07:53:48 GMT):
for builtins i need some resource where i can look into about the docs of the builtin tokens

seanyoung (Fri, 16 Oct 2020 09:25:51 GMT):
Good afternoon

seanyoung (Fri, 16 Oct 2020 09:26:09 GMT):
Sorry I was supposed to add documentation to solang for this. I've been a bit busy.

simeon4real (Fri, 16 Oct 2020 22:04:11 GMT):
Has joined the channel.

simeon4real (Fri, 16 Oct 2020 22:04:12 GMT):
Hello, I downloaded the solang compiler from https://github.com/hyperledger-labs/solang/releases/download/v0.1.4/solang_linux and having problems installing

simeon4real (Fri, 16 Oct 2020 22:50:08 GMT):
GLIBC_2.29' not found (required by ./solang_linux)

seanyoung (Sat, 17 Oct 2020 09:27:33 GMT):
@simeon4real what distribution of linux are you using and what version?

seanyoung (Sat, 17 Oct 2020 09:28:35 GMT):
Actually solang gets built on ubuntu-20.04. That is probably a mistake.

sbalikondwar (Sat, 17 Oct 2020 09:29:30 GMT):
Yes Solang gets built on Ubuntu

sbalikondwar (Sat, 17 Oct 2020 09:29:39 GMT):
Infact I have Ubuntu myself

sbalikondwar (Sat, 17 Oct 2020 09:30:07 GMT):
You need to install glibc dev files and build tools libs

sbalikondwar (Sat, 17 Oct 2020 09:30:55 GMT):
Morning Sean, how is the cold!

sbalikondwar (Sat, 17 Oct 2020 09:30:55 GMT):
Morning Sean, how is the cold temp!

sbalikondwar (Sat, 17 Oct 2020 09:32:11 GMT):
Let me know when you are free we can keep it aside for now

seanyoung (Sat, 17 Oct 2020 09:33:30 GMT):
@simeon4real is using the binary which is built for ubuntu-20.04. If the binary was built on an earlier version of ubuntu, then it might work.

seanyoung (Sat, 17 Oct 2020 09:34:27 GMT):
@sbalikondwar good morning, still 10C here! Very cold.

sbalikondwar (Sat, 17 Oct 2020 09:34:32 GMT):
Perhaps we can dockerize deps in later releases

seanyoung (Sat, 17 Oct 2020 09:36:05 GMT):
It is dockerized: https://hub.docker.com/repository/docker/hyperledgerlabs/solang/

sbalikondwar (Sat, 17 Oct 2020 09:36:42 GMT):
Oh great!, I am lucky the weather is usually sunny 20-30C

seanyoung (Sat, 17 Oct 2020 09:49:19 GMT):
Thanks, I should get that soon

seanyoung (Sat, 17 Oct 2020 19:11:10 GMT):
@sbalikondwar https://github.com/hyperledger-labs/solang/commit/c4023b933dbbdfabde8180c871eafbdb8f0d6348

sbalikondwar (Mon, 19 Oct 2020 16:06:46 GMT):
Good evening

sbalikondwar (Mon, 19 Oct 2020 16:06:55 GMT):
I had test today so am working latr

sbalikondwar (Mon, 19 Oct 2020 16:06:59 GMT):
Late

seanyoung (Mon, 19 Oct 2020 16:07:29 GMT):
Good evening

seanyoung (Mon, 19 Oct 2020 16:07:33 GMT):
How was the test?

sbalikondwar (Mon, 19 Oct 2020 16:10:33 GMT):
It was good, basically remote online tests (So we classmates ended up sharing all answers 🤣) but I am sure I'll get good scores

sbalikondwar (Mon, 19 Oct 2020 16:11:06 GMT):
The tests are till Friday, but I'll make sure to work on regular times

sbalikondwar (Mon, 19 Oct 2020 16:12:45 GMT):
This week the work is to be on struct field

seanyoung (Mon, 19 Oct 2020 16:13:43 GMT):
🤣🤣🤣

sbalikondwar (Mon, 19 Oct 2020 16:14:03 GMT):
the doc work you added is great

sbalikondwar (Mon, 19 Oct 2020 16:14:16 GMT):
will just hook it in the hovers

seanyoung (Mon, 19 Oct 2020 16:14:35 GMT):
Actually I'm not sure how the doc can be accessed from solang-server

seanyoung (Mon, 19 Oct 2020 16:14:52 GMT):
I think it needs some sort of accesser function

sbalikondwar (Mon, 19 Oct 2020 16:15:20 GMT):
There is builtin token case in match statements, so I will write a simple case match and extract it

sbalikondwar (Mon, 19 Oct 2020 16:15:48 GMT):
I will have to update solang though

sbalikondwar (Mon, 19 Oct 2020 16:16:06 GMT):
so will first complete the struct field work and then do builtin work

sbalikondwar (Mon, 19 Oct 2020 16:20:59 GMT):
what do you meant by struct entry hovers?

sbalikondwar (Mon, 19 Oct 2020 16:22:29 GMT):
cause I can see it works for struct entries, at some places it can misalign with offsets

sbalikondwar (Mon, 19 Oct 2020 16:22:52 GMT):

Screenshot from 2020-10-19 21-51-24.png

sbalikondwar (Mon, 19 Oct 2020 16:22:52 GMT):

Screenshot from 2020-10-19 21-51-54.png

sbalikondwar (Mon, 19 Oct 2020 16:23:22 GMT):
the hover was for struct Voter { uint weight; // weight is accumulated by delegation bool voted; // if true, that person already voted address delegate; // person delegated to uint vote; // index of the voted proposal }

seanyoung (Mon, 19 Oct 2020 16:24:53 GMT):
I think there are some other issues which prevent the hover from working. I might be easier to work with simpler contract with no compile errors.

seanyoung (Mon, 19 Oct 2020 16:25:49 GMT):
All I meant was: ``` contract bar { struct foo { bool f1; uint32 f2; } constructor(foo s) { // } } ``` If you hover over `foo`, the first argument to the constructor, it should show you that it is a struct and what the fields are

sbalikondwar (Mon, 19 Oct 2020 16:27:05 GMT):
yes i get it,

avcdsld (Tue, 20 Oct 2020 00:57:04 GMT):
Has joined the channel.

avcdsld (Tue, 20 Oct 2020 00:57:04 GMT):
Hi, I have a question about Solang. Does Solang currently support address type and its transfer function? (Is this example up to date? https://github.com/hyperledger-labs/solang/blob/master/examples/full_example.sol )

seanyoung (Tue, 20 Oct 2020 09:06:23 GMT):
@avcdsld address type and transfer/send should be fully supported. Is there something which is not working for you?

avcdsld (Tue, 20 Oct 2020 09:38:03 GMT):
@seanyoung Thanks for your reply. I see. I'm trying to isolate the cause of the error. I may ask again.

seanyoung (Tue, 20 Oct 2020 09:38:24 GMT):
What is the error?

seanyoung (Tue, 20 Oct 2020 09:38:32 GMT):
I might be able to help

avcdsld (Tue, 20 Oct 2020 09:44:56 GMT):
Thanks. I'm trying to deploy wasm compiled with solang to the Plasm Network's local net and execute a function that involves sending ETH, but I get an error (I can't get details from the log...)

avcdsld (Tue, 20 Oct 2020 09:45:09 GMT):
This may be an issue with the Plasm Network, but Is there anything wrong with the following contract?

avcdsld (Tue, 20 Oct 2020 09:45:15 GMT):
``` contract SimpleAuction { address payable public beneficiary; uint256 public auctionEndTimestamp; address public highestBidder; uint128 public highestBid; bool ended; constructor(uint256 _biddingTime) { beneficiary = msg.sender; auctionEndTimestamp = now + _biddingTime; } receive () payable external {} function bid() public payable { highestBidder = msg.sender; highestBid = msg.value; } function auctionEnd() public { ended = true; beneficiary.transfer(highestBid); } } ```

avcdsld (Tue, 20 Oct 2020 09:47:25 GMT):
(I've simplified the code considerably to identify the problem. The logic is not the finished version.)

seanyoung (Tue, 20 Oct 2020 09:48:33 GMT):
At which point does it fail? At deploy time, bid, or autionend?

avcdsld (Tue, 20 Oct 2020 09:49:19 GMT):
I get an error when I call bit()

avcdsld (Tue, 20 Oct 2020 09:49:19 GMT):
I get an error when I call bid()

sbalikondwar (Wed, 21 Oct 2020 11:16:37 GMT):
good afternoon

seanyoung (Wed, 21 Oct 2020 11:25:52 GMT):
good afternoon

sbalikondwar (Wed, 21 Oct 2020 11:29:59 GMT):
meet time

sbalikondwar (Thu, 22 Oct 2020 07:28:31 GMT):
good morning

seanyoung (Thu, 22 Oct 2020 10:23:12 GMT):
good morning

sbalikondwar (Sun, 25 Oct 2020 14:54:32 GMT):
good evening

sbalikondwar (Sun, 25 Oct 2020 14:54:56 GMT):
this week i have been more busy with tests and festivities

sbalikondwar (Mon, 26 Oct 2020 04:58:16 GMT):
added support for struct definition hovers

sbalikondwar (Mon, 26 Oct 2020 04:58:29 GMT):

Screenshot from 2020-10-26 10-27-37.png

seanyoung (Mon, 26 Oct 2020 08:55:15 GMT):
Good afternoon Looks great!

sbalikondwar (Mon, 26 Oct 2020 10:34:35 GMT):
@seanyoung can you give me a sample example of how should be the message for builtin types

sbalikondwar (Mon, 26 Oct 2020 10:35:13 GMT):
like for Prototype { builtin: Builtin::Value, namespace: Some("msg"), name: "value", args: &[], ret: &[Type::Value], target: None, doc: "Value sent with current call", },

sbalikondwar (Mon, 26 Oct 2020 15:13:04 GMT):
By the way Sean how is your workstation, I am thinking to add dual monitors Any tips that help productivity!

sbalikondwar (Tue, 27 Oct 2020 07:34:22 GMT):
good morning

seanyoung (Tue, 27 Oct 2020 09:11:39 GMT):
Good afternoon Sorry I was busy with other things yesterday

seanyoung (Tue, 27 Oct 2020 09:14:44 GMT):
I use a laptop with a monitor. I do like to be able to open two source files in vscode at the same time, so I have 2560x1440 monitor (24"). That way you can work very well with two files.

seanyoung (Tue, 27 Oct 2020 09:15:41 GMT):
Let me have a look at the builtins

AndrewPark 1 (Tue, 27 Oct 2020 09:22:38 GMT):
Has joined the channel.

seanyoung (Tue, 27 Oct 2020 10:18:10 GMT):
@sbalikondwar https://github.com/hyperledger-labs/solang/pull/299 Sorry this took so long. Builtins really are a nice-to-have, in other words not needed, for the language server.

sbalikondwar (Tue, 27 Oct 2020 10:48:27 GMT):
@seanyoung the pr is very helpful

sbalikondwar (Tue, 27 Oct 2020 10:48:57 GMT):
though i myself made the prototype public and tried some method yesterday

sbalikondwar (Tue, 27 Oct 2020 10:49:34 GMT):
but it was working different, I am happy that its now upstream

sbalikondwar (Tue, 27 Oct 2020 10:50:00 GMT):
so i was asking about message of the hover

sbalikondwar (Tue, 27 Oct 2020 10:50:13 GMT):
how do you want the hover message to be for lets say

sbalikondwar (Tue, 27 Oct 2020 10:50:28 GMT):
Prototype { builtin: Builtin::Value, namespace: Some("msg"), name: "value", args: &[], ret: &[Type::Value], target: None, doc: "Value sent with current call", },

sbalikondwar (Tue, 27 Oct 2020 10:51:16 GMT):
should it be, "Value sent with current call by msg of type type"

seanyoung (Tue, 27 Oct 2020 10:52:24 GMT):
That is great, I think it useful to give the type and the name again. `uint128 msg.value: Value sent with current call`

seanyoung (Tue, 27 Oct 2020 10:52:51 GMT):
For variables you can assume there is always one return value

sbalikondwar (Tue, 27 Oct 2020 10:53:27 GMT):
yeah sure

sbalikondwar (Tue, 27 Oct 2020 10:54:35 GMT):
I think having a decent monitor is a genuine issue

seanyoung (Tue, 27 Oct 2020 10:54:58 GMT):
Which monitors do you like?

sbalikondwar (Tue, 27 Oct 2020 10:55:12 GMT):
i will also setup similar infra, by the way does your laptop give heating issues if connected hdmi for long time

sbalikondwar (Tue, 27 Oct 2020 10:55:31 GMT):
I will be opting for curved 24 inch one

seanyoung (Tue, 27 Oct 2020 10:55:56 GMT):
The curved ones do look very nice

seanyoung (Tue, 27 Oct 2020 10:56:57 GMT):
My laptop does get very hot, mostly when maxing out the cpu for hours like when building llvm. I have Windows VM and building llvm in there takes about 6 hours - it gets very hot to the touch when doing that.

seanyoung (Tue, 27 Oct 2020 10:58:58 GMT):
Weirdly the monitor I got wasn't available through amazon or any online retailer, I had to buy it directly from samsung.

sbalikondwar (Tue, 27 Oct 2020 10:59:32 GMT):
haha, I will order it over amazon this week

AndrewPark 1 (Tue, 27 Oct 2020 11:00:07 GMT):
Is it possible to integrate with hyperledger fabric?

seanyoung (Tue, 27 Oct 2020 11:03:38 GMT):
@AndrewPark 1 so at the moment, no that's not possible. Solang produces wasm files and those can't run on fabric. Fabric is working on wasm chaincode: https://lists.hyperledger.org/g/fabric/message/9031 There will be some integration work to wire up the various calls like set state etc. I've been talking to @mbwhite from IBM and there is interest to make this work.

mbwhite (Tue, 27 Oct 2020 11:03:38 GMT):
Has joined the channel.

AndrewPark 1 (Tue, 27 Oct 2020 11:05:44 GMT):
Thanks @seanyoung I have look more detail about the article mbwhite wrote.

AndrewPark 1 (Tue, 27 Oct 2020 11:05:44 GMT):
Thanks @seanyoung I have to look more detail about the article mbwhite wrote.

sbalikondwar (Tue, 27 Oct 2020 11:13:29 GMT):
how is the covid situation sean

seanyoung (Tue, 27 Oct 2020 11:16:31 GMT):
Numbers are still going up unfortunately, not looking great. There was some good news though: https://www.theguardian.com/world/2020/oct/27/covid-vaccine-uk-oxford-university-astrazeneca-works-in-all-ages-trials-suggest

sbalikondwar (Tue, 27 Oct 2020 11:19:30 GMT):
any household medication people following?

seanyoung (Tue, 27 Oct 2020 11:20:04 GMT):
Not that I am aware off. How is your situation?

sbalikondwar (Tue, 27 Oct 2020 11:21:12 GMT):
its going good, 90% recovery rate !

sbalikondwar (Tue, 27 Oct 2020 11:21:13 GMT):
https://www.thehindu.com/news/national/coronavirus-recovery-rate-touches-90-only-85-of-total-caseload-active-in-india/article32940467.ece

sbalikondwar (Tue, 27 Oct 2020 11:22:24 GMT):
there are now 2000+ testing labs countrywide

seanyoung (Tue, 27 Oct 2020 11:29:23 GMT):
That is a lot of labs! Do you know what the turn-around time is for a test?

sbalikondwar (Tue, 27 Oct 2020 11:30:52 GMT):
I just tested your changes in a small snippet for builtin hover and it is working, will now add messages for all types

sbalikondwar (Tue, 27 Oct 2020 11:31:39 GMT):
its like 1-2 days for the test results, but i see there are other tools which give tests in just minutes

sbalikondwar (Tue, 27 Oct 2020 11:33:39 GMT):
going for evening break :coffee:

seanyoung (Tue, 27 Oct 2020 11:34:09 GMT):
enjoy

sbalikondwar (Wed, 28 Oct 2020 04:54:41 GMT):
good morning

sbalikondwar (Wed, 28 Oct 2020 05:04:03 GMT):
'cannot find prototype for ArrayPush'

sbalikondwar (Wed, 28 Oct 2020 05:04:18 GMT):
i think some defs are left out in builtins

sbalikondwar (Wed, 28 Oct 2020 05:08:43 GMT):
for others it is working

sbalikondwar (Wed, 28 Oct 2020 05:08:55 GMT):

Screenshot from 2020-10-28 10-38-13.png

mbwhite (Wed, 28 Oct 2020 08:25:33 GMT):
Thanks for link you this channel seanyoung.. I'll take a longer look when I'm back at work next week.

sbalikondwar (Wed, 28 Oct 2020 11:28:25 GMT):
We got meet in couple of minutes

seanyoung (Wed, 28 Oct 2020 11:32:34 GMT):
https://github.com/hyperledger-labs/solang/pull/298

sbalikondwar (Wed, 28 Oct 2020 11:38:41 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L320

sbalikondwar (Wed, 28 Oct 2020 11:51:56 GMT):
going for my evening break :coffee:

seanyoung (Wed, 28 Oct 2020 11:53:08 GMT):
enjoy

sbalikondwar (Thu, 29 Oct 2020 09:28:55 GMT):
Good morning

sbalikondwar (Thu, 29 Oct 2020 09:29:44 GMT):
Sean whenever you get time, let me know about the import files

seanyoung (Thu, 29 Oct 2020 10:26:58 GMT):
Good afternoon

seanyoung (Thu, 29 Oct 2020 10:27:20 GMT):
I've been thinking about how to test this.

seanyoung (Thu, 29 Oct 2020 10:43:54 GMT):
Say you have `a.sol`: ``` contract a { bool public foo; } ``` And also `b.sol`: ``` import "a.sol"; contract b { int32 public x; } ``` Now, when solang compiles `b.sol` it has a namespace with two contracts, also two entries in the `files` field `b.sol` and `a.sol`. One of the contracts will have a loc field `pt::Loc(1, ... )` and the other `pt::Loc(0, ...)`. The 1 or 0 indicates an offset in the `files` field. It is important that the contract for `a.sol` is not used for calulating offsets.

sbalikondwar (Fri, 30 Oct 2020 03:54:17 GMT):
good morning

seanyoung (Fri, 30 Oct 2020 10:41:24 GMT):
good morning I merged this so missing builtin prototypes don't panic. https://github.com/hyperledger-labs/solang/commit/91290e6c3a667f4abe473d516c0f1910888085ce

sbalikondwar (Fri, 30 Oct 2020 10:45:31 GMT):
Ok will check it out

sbalikondwar (Sat, 31 Oct 2020 04:46:49 GMT):
@seanyoung I see there are some changes in solang that break the server code

sbalikondwar (Sat, 31 Oct 2020 04:46:57 GMT):
can you please keep them

sbalikondwar (Sat, 31 Oct 2020 04:47:00 GMT):
like

sbalikondwar (Sat, 31 Oct 2020 04:50:03 GMT):
It used to have functionno and contract no that was used to find function defs and all for server https://github.com/hyperledger-labs/solang/blob/6de6d44b4796213649790639c1b59c35603cac0c/src/sema/ast.rs#L497

sbalikondwar (Sat, 31 Oct 2020 04:50:44 GMT):
but now its https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L517

sbalikondwar (Sat, 31 Oct 2020 04:50:53 GMT):
so i first used it like

sbalikondwar (Sat, 31 Oct 2020 04:51:07 GMT):
InternalFunctionCall { loc, returns:_, contract_no, function_no, signature:_, args:_, } => { let fnc_nam = &ns.contracts[*contract_no].functions[*function_no].name; let fnc_sig = &ns.contracts[*contract_no].functions[*function_no].signature; let fnc_ky = format!("{}{}", fnc_nam, fnc_sig); if fnc_map.contains_key(&fnc_ky) { match fnc_map.get(&fnc_ky) { Some(ans) => { let nm = format!("{}", ans[..].to_string()); lookup_tbl.push((loc.1 as u64, loc.2 as u64, nm)); } _ => {} } }}

sbalikondwar (Sat, 31 Oct 2020 04:51:25 GMT):
now i can't use it!

seanyoung (Sat, 31 Oct 2020 08:20:20 GMT):
@sbalikondwar right, that will break the server. The problem is that in Solidity, you can declare a function type like `func` in this example: ``` contract Arith { function test(bool action, int32 a, int32 b) public returns (int32) { function(int32,int32) internal returns (int32) func; if (action) { func = mul; } else { func = add; } return func(a, b); } function mul(int32 a, int32 b) internal virtual returns (int32) { return a * b; } function add(int32 a, int32 b) internal virtual returns (int32) { return a + b; } } ``` So, when `func(...)` is called, func is a reference to a function. The `Expression::InternalFunctionCall` changed so that the function being called can be an expression. I'm afraid I can't change the code back, this is a feature which is needed for Solang. You can change your code to: ``` InternalFunctionCall { loc, function, .. } => { if let Expression::InternalFunction { contract_no, function_no, .. } = function.as_ref() { ... } } ```

seanyoung (Sat, 31 Oct 2020 09:34:47 GMT):
I'm afraid I'm making the same changes to the external function call today

sbalikondwar (Sat, 31 Oct 2020 09:42:14 GMT):
no I am not sure, now I will have to check for some other way of implementation

sbalikondwar (Sat, 31 Oct 2020 09:42:28 GMT):
these changes in ast are quite random

sbalikondwar (Sat, 31 Oct 2020 09:43:03 GMT):
I hope from next time they stay for backward compatible

sbalikondwar (Sat, 31 Oct 2020 09:43:59 GMT):
just a suggestion can you keep function_no, signature and contract_no fields in internalfunctioncall

seanyoung (Sat, 31 Oct 2020 09:45:18 GMT):
When resolving `func(arg1, arg2)`, `func` does not have to be a function. It can be a variable or any expression which resolves to a function.

seanyoung (Sat, 31 Oct 2020 09:46:14 GMT):
So, InternalFunctionCall cannot be just the contract_no and function_no. You can pin solang-server to a specific version of solang if you don't want to update your code -- I do get that solang is a moving target.

sbalikondwar (Sat, 31 Oct 2020 09:46:34 GMT):
yes thats comforting

sbalikondwar (Sat, 31 Oct 2020 09:47:18 GMT):
for now that I will do is, use the older solang and once I resolve the issues/bugs

sbalikondwar (Sat, 31 Oct 2020 09:47:32 GMT):
Then will do a FINAL revamp

sbalikondwar (Sat, 31 Oct 2020 09:47:39 GMT):
how does that sound?

sbalikondwar (Sat, 31 Oct 2020 09:47:44 GMT):
good morning

seanyoung (Sat, 31 Oct 2020 10:09:10 GMT):
That sounds great!

seanyoung (Sat, 31 Oct 2020 10:09:16 GMT):
Good afternoon

seanyoung (Sun, 01 Nov 2020 10:40:17 GMT):
Good afternoon Please do make sure you have solang set to a particular commit in your Cargo.toml, since I'm unfortunately having to make more changes to the ast.

seanyoung (Sun, 01 Nov 2020 10:54:59 GMT):
At some point in the future, it may be useful to make solang-server part of the solang repo. That way, it is always up-to-date with the latest solang compiler ast. Also, if it is part of the solang binary, then it can be run like so `solang --language-server` (or something like that). Anyway something for the future.

sbalikondwar (Sun, 01 Nov 2020 10:55:57 GMT):
Yeah it can, Sean I have some college work today and tomorrow regarding my final year project

sbalikondwar (Sun, 01 Nov 2020 10:56:09 GMT):
So I'll be a bit less available

sbalikondwar (Sun, 01 Nov 2020 10:56:17 GMT):
Good afternoon

sbalikondwar (Sun, 01 Nov 2020 10:56:32 GMT):
I see now I'll keep Solang version in check

sbalikondwar (Sun, 01 Nov 2020 10:56:55 GMT):
And make local changes which can further lead to a commit later

sbalikondwar (Sun, 01 Nov 2020 10:57:01 GMT):
Sort of fork and work

seanyoung (Sun, 01 Nov 2020 10:58:24 GMT):
Sure, of course. Hope you don't mind if I ask, do you have ideas for your final year project?

sbalikondwar (Sun, 01 Nov 2020 11:13:49 GMT):
I have decided about it but when I am doing for college it's not that important So many people keep it minimal and not too complex

sbalikondwar (Sun, 01 Nov 2020 11:14:28 GMT):
It's a farmer tutor app which predicts crop yields and weather and other parameters

sbalikondwar (Sun, 01 Nov 2020 11:14:50 GMT):
Sort of a buddy guiding farming activities

sbalikondwar (Sun, 01 Nov 2020 11:15:21 GMT):
I am working on Machine Learning models for that in my free time which is quite interesting

seanyoung (Sun, 01 Nov 2020 11:15:55 GMT):
That sounds really interesting. Machine learning has become very interesting in recent years

sbalikondwar (Sun, 01 Nov 2020 15:43:16 GMT):
Yes it is, by the way how is lockdown there

sbalikondwar (Sun, 01 Nov 2020 15:43:36 GMT):
I just read yesterday it was a new lockdown

seanyoung (Sun, 01 Nov 2020 17:36:10 GMT):
Yes, there will be a new lockdown on Thursday. Well, parliament still has to vote on it on Wednesday. Looks like this one will be very strict.

sbalikondwar (Tue, 03 Nov 2020 06:44:47 GMT):
oh, better store necessities

sbalikondwar (Tue, 03 Nov 2020 06:44:52 GMT):
good morning

seanyoung (Tue, 03 Nov 2020 10:55:04 GMT):
good afternoon We ordered some shopping online and already things like yeast for breadmaking has run out again. Bit annoying but not exactly the worst thing to happen to anyone during the pandemic.

sbalikondwar (Tue, 03 Nov 2020 11:07:13 GMT):
wow, that's new for me

sbalikondwar (Tue, 03 Nov 2020 11:07:39 GMT):
I haven't heard of homemade bread in quite sometime

sbalikondwar (Tue, 03 Nov 2020 11:08:04 GMT):
Better also to check medical supplies

seanyoung (Tue, 03 Nov 2020 11:08:58 GMT):
It's become a lot more popular here. Fresh bread is hard to get delivered, so people make their own.

sbalikondwar (Tue, 03 Nov 2020 11:09:37 GMT):
Oh yes seems reasonable its just here bread is very rare eaten bakery

sbalikondwar (Tue, 03 Nov 2020 11:09:37 GMT):
Oh yes seems reasonable its just here bread is very rare eaten bakery product

sbalikondwar (Tue, 03 Nov 2020 11:10:16 GMT):
By the way is the lockdown implemented? is it is same as used to be in feb and march months

sbalikondwar (Tue, 03 Nov 2020 11:10:16 GMT):
By the way is the lockdown implemented? is it same as used to be in feb and march months

seanyoung (Tue, 03 Nov 2020 11:12:56 GMT):
It will be pretty similar to the one in march, but now schools/universities will be open (with lots of remote lessons and contact bubbles)

seanyoung (Tue, 03 Nov 2020 11:14:03 GMT):
I think bread has been a European staple since Roman times, we do eat a lot of bread :laughing:

sbalikondwar (Tue, 03 Nov 2020 11:16:09 GMT):
It sure has been

sbalikondwar (Tue, 03 Nov 2020 11:17:33 GMT):
So as I told on sunday I have used one previous commit as reference point, monday i was busy doing my college work so from today I have followed up on the task of fixing issues and making it deploy ready

sbalikondwar (Tue, 03 Nov 2020 11:18:19 GMT):
So i will look on how to package the implementation in parallel with the usual bug fix work

sbalikondwar (Tue, 03 Nov 2020 11:30:44 GMT):
For now for simple constructs the import seems to work

sbalikondwar (Tue, 03 Nov 2020 11:31:07 GMT):
so it shall work ideally on others

sbalikondwar (Tue, 03 Nov 2020 11:31:27 GMT):
But looking more into it with other issues

sbalikondwar (Tue, 03 Nov 2020 11:33:04 GMT):

Screenshot from 2020-11-03 17-00-08.png

sbalikondwar (Tue, 03 Nov 2020 11:33:05 GMT):

Screenshot from 2020-11-03 17-00-00.png

seanyoung (Tue, 03 Nov 2020 11:33:53 GMT):
nice!

sbalikondwar (Tue, 03 Nov 2020 11:34:01 GMT):
a.sol is

sbalikondwar (Tue, 03 Nov 2020 11:34:02 GMT):
contract a { string public nm = "abac"; function nname() view public returns (string memory) { return nm; } }

sbalikondwar (Wed, 04 Nov 2020 10:41:42 GMT):
good morning

seanyoung (Wed, 04 Nov 2020 10:50:18 GMT):
good morning

seanyoung (Wed, 04 Nov 2020 10:54:14 GMT):
More changes to the ast were merged, so I hope you have solang pinned to a commit in your cargo.toml.

seanyoung (Wed, 04 Nov 2020 10:54:17 GMT):
https://github.com/hyperledger-labs/solang/commit/080c6c4c3869114b847a2c90890b2439ab99799b

seanyoung (Wed, 04 Nov 2020 10:54:49 GMT):
Solidity now also supports functions outside of contracts, so to support that, more changes to the ast are needed.

sbalikondwar (Wed, 04 Nov 2020 10:56:21 GMT):
Yes i already had it pinned to a commit :thumbsup:

sbalikondwar (Wed, 04 Nov 2020 10:57:02 GMT):
those are some big changes

seanyoung (Wed, 04 Nov 2020 10:58:12 GMT):
Yes, I'm a bit daunted by this :grimacing:

sbalikondwar (Wed, 04 Nov 2020 11:23:00 GMT):
we got meet in about 8 mins

seanyoung (Wed, 04 Nov 2020 11:23:18 GMT):
yes, we do.

sbalikondwar (Wed, 04 Nov 2020 11:33:23 GMT):
https://code.visualstudio.com/api/working-with-extensions/publishing-extension

sbalikondwar (Wed, 04 Nov 2020 11:33:29 GMT):
https://itnext.io/creating-and-publishing-vs-code-extensions-912b5b8b529

sbalikondwar (Wed, 04 Nov 2020 18:25:50 GMT):
Logging off for today

sbalikondwar (Wed, 04 Nov 2020 18:26:20 GMT):
Good evening

seanyoung (Wed, 04 Nov 2020 18:49:35 GMT):
Good evening

sbalikondwar (Thu, 05 Nov 2020 07:41:58 GMT):
good morning

seanyoung (Thu, 05 Nov 2020 11:53:40 GMT):
good morning

seanyoung (Thu, 05 Nov 2020 11:54:42 GMT):
@sbalikondwar did you see the invite for the presentations on the 13th and 17th?

sbalikondwar (Thu, 05 Nov 2020 14:45:32 GMT):
Yes I got the mails

sbalikondwar (Mon, 09 Nov 2020 11:21:20 GMT):
@seanyoung good morning

sbalikondwar (Mon, 09 Nov 2020 11:22:38 GMT):
I had one problem, lets say i have a vector slice tbl as &mut [(u64, u64, std::string::String)] then how can i perform index operations on it

sbalikondwar (Mon, 09 Nov 2020 11:22:45 GMT):
like tbl[0]

sbalikondwar (Mon, 09 Nov 2020 11:23:05 GMT):
it raises issue that the copy trait is not implemented

seanyoung (Mon, 09 Nov 2020 11:26:56 GMT):
good afternoon

seanyoung (Mon, 09 Nov 2020 11:27:26 GMT):
I think what the problem here is that the index operation requires an owned string

seanyoung (Mon, 09 Nov 2020 11:27:58 GMT):
so you would you need index with `foo[&(1, 2, "foo".to_owned())]`

seanyoung (Mon, 09 Nov 2020 11:32:02 GMT):
@sbalikondwar it would be good to have a pull request soon, there might be some re-work needed

sbalikondwar (Mon, 09 Nov 2020 11:32:50 GMT):
yes sean i got in work last work, so there is some delay but i remember

sbalikondwar (Mon, 09 Nov 2020 11:32:50 GMT):
yes sean i got in work last week, so there is some delay but i remember

sbalikondwar (Mon, 09 Nov 2020 11:32:56 GMT):
its up for a PR

sbalikondwar (Mon, 09 Nov 2020 11:33:05 GMT):
and i have speed up the work

sbalikondwar (Mon, 09 Nov 2020 14:05:05 GMT):
how is the lockdown feeling by the way

sbalikondwar (Tue, 10 Nov 2020 09:24:32 GMT):
sean I have fixed the bugs that I observed with hover implementations

sbalikondwar (Tue, 10 Nov 2020 09:24:59 GMT):
for now i am looking into packaging it and how to make it work as an installed binary

sbalikondwar (Tue, 10 Nov 2020 09:25:28 GMT):
should i open pr now for ths fixes

sbalikondwar (Tue, 10 Nov 2020 09:25:28 GMT):
should i open pr now for the fixes

seanyoung (Tue, 10 Nov 2020 09:30:32 GMT):
Yes, that would great, thank you

sbalikondwar (Tue, 10 Nov 2020 09:33:24 GMT):
ok, I have some work at the market so will be back in 2-3 hour and will ping you when I opened the PR

sbalikondwar (Tue, 10 Nov 2020 09:33:24 GMT):
ok, I have some work at the market so will be back in 2-3 hour and will ping you when I have opened the PR

sbalikondwar (Tue, 10 Nov 2020 09:33:24 GMT):
ok, I have some work at the market so will be back in 2-3 hour and will ping you when I have opened a PR

sbalikondwar (Tue, 10 Nov 2020 09:33:29 GMT):
good morning

seanyoung (Tue, 10 Nov 2020 09:37:06 GMT):
Great!

seanyoung (Tue, 10 Nov 2020 09:37:12 GMT):
Good morning/afternoon to you

seanyoung (Tue, 10 Nov 2020 09:37:49 GMT):
People are calling the 2nd lockdown here "lockdown 2". Very similar to the last lockdown

sbalikondwar (Tue, 10 Nov 2020 09:38:15 GMT):
I bet it is same feeling as the first

sbalikondwar (Tue, 10 Nov 2020 09:39:05 GMT):
as I am done with the implementation work and just the packaging is remaining, I thought of booking 13th Nov as the date for hyperledger presentation

sbalikondwar (Tue, 10 Nov 2020 09:40:44 GMT):
Cause I have festivities from 14th, the significance is much like as it is christmas in UK

sbalikondwar (Tue, 10 Nov 2020 09:40:44 GMT):
Cause I have festivities from 14th, the popularity is much like as it is christmas in UK

sbalikondwar (Tue, 10 Nov 2020 10:06:49 GMT):
https://www.bbc.co.uk/newsround/15451833

seanyoung (Tue, 10 Nov 2020 10:21:13 GMT):
Diwali is celebrated here as well, although with lockdown there is much less happening. It's a shame, because it's very enjoyable!

seanyoung (Tue, 10 Nov 2020 23:38:52 GMT):
tests aren't passing on https://github.com/hyperledger-labs/solang-vscode/pull/10

sbalikondwar (Wed, 11 Nov 2020 07:56:08 GMT):
good morning

sbalikondwar (Wed, 11 Nov 2020 08:35:11 GMT):
the issue is for headless tests as defined here https://github.com/GabrielBB/xvfb-action hovers can't be testes on the ci

sbalikondwar (Wed, 11 Nov 2020 08:35:11 GMT):
the issue is for headless tests as implemented by https://github.com/GabrielBB/xvfb-action hovers can't be testes on the ci

sbalikondwar (Wed, 11 Nov 2020 08:35:11 GMT):
the issue is for headless tests as implemented by https://github.com/GabrielBB/xvfb-action hovers can't be tested on the ci

sbalikondwar (Wed, 11 Nov 2020 08:36:40 GMT):
infact to all other vscode servers and clients I have referred the themselves haven't implemented on ci

sbalikondwar (Wed, 11 Nov 2020 08:36:40 GMT):
infact to all other vscode servers and clients I have referred like tremor-vscode (https://github.com/tremor-rs/tremor-vscode/blob/main/.github/workflows/ts.yml), the themselves haven't implemented on ci

sbalikondwar (Wed, 11 Nov 2020 08:37:24 GMT):
as an improvement i have made it possible to atleast test those implementation when you test it locally

seanyoung (Wed, 11 Nov 2020 09:19:11 GMT):
Good morning

seanyoung (Wed, 11 Nov 2020 09:19:20 GMT):
at least the ci tests are passing now, so building tested

seanyoung (Wed, 11 Nov 2020 09:20:18 GMT):
function returns don't have hovers, neither to parameter unless they're enum or struct

seanyoung (Wed, 11 Nov 2020 09:21:21 GMT):
function call arguments aren't processed

sbalikondwar (Wed, 11 Nov 2020 09:22:52 GMT):
wait i am a bit confused

sbalikondwar (Wed, 11 Nov 2020 09:23:16 GMT):
do you have an example i can test it on

seanyoung (Wed, 11 Nov 2020 09:25:40 GMT):
``` struct bar { uint32 f1; uint32 f2; } contract c { function foo(bar x) public pure { foo1(102); } function foo1(uint32 y) public pure { } } ```

seanyoung (Wed, 11 Nov 2020 09:25:40 GMT):
``` struct bar { uint32 f1; uint32 f2; } contract c { function foo(bar x) public pure { uint32 f = 102; foo1(f); } function foo1(uint32 y) public pure { } }```

seanyoung (Wed, 11 Nov 2020 09:25:40 GMT):
``` struct bar { uint32 f1; uint32 f2; } contract c { function foo(bar x) public pure returns (uint32 f) { f = 102; foo1(f); } function foo1(uint32 y) public pure { } }```

sbalikondwar (Wed, 11 Nov 2020 09:28:51 GMT):
looking into it

seanyoung (Wed, 11 Nov 2020 09:31:19 GMT):
I don't understand, hover doesn't seem to be working half the time

seanyoung (Wed, 11 Nov 2020 09:35:21 GMT):
I don't get any hover for the file above

seanyoung (Wed, 11 Nov 2020 09:36:12 GMT):
if I select any text I get an error

seanyoung (Wed, 11 Nov 2020 09:37:44 GMT):
``` [Error - 09:37:30] Request textDocument/documentHighlight failed. Message: Method not found Code: -32601 ```

sbalikondwar (Wed, 11 Nov 2020 09:38:55 GMT):
yes i will have to remove the debug info there

seanyoung (Wed, 11 Nov 2020 09:43:40 GMT):
there is no hover for `block.number`

seanyoung (Wed, 11 Nov 2020 09:43:57 GMT):
also the hover randomly don't seem to work

sbalikondwar (Wed, 11 Nov 2020 10:00:03 GMT):
yes there is some issue with the hover, the lookup function to be exact inside the table I am able to generate the messages

sbalikondwar (Wed, 11 Nov 2020 10:00:03 GMT):
yes there is some issue with the hover, the lookup function to be exact, inside the table I am able to generate the messages

sbalikondwar (Wed, 11 Nov 2020 10:00:03 GMT):
l:7 r:10 msg: l:17 r:26 msg:uint32 f1 l:32 r:41 msg:uint32 f2 l:46 r:46 msg: fncmap sig:foo1foo1(uint32) msg: Function foo1( y:uint32, ) returns ()sig:foofoo(tuple) msg: Function foo( ) returns ()sig:bar msg: struct bar { uint32 f1, uint32 f2, }

sbalikondwar (Wed, 11 Nov 2020 10:02:07 GMT):
so I have some doubts regarding same which we can discuss in todays meet

seanyoung (Wed, 11 Nov 2020 11:36:13 GMT):
function foo(bar x) public pure returns (uint32 *f*) {}

sbalikondwar (Wed, 11 Nov 2020 11:38:03 GMT):
https://github.com/hyperledger-labs/solang/blob/master/src/sema/ast.rs#L113

sbalikondwar (Wed, 11 Nov 2020 11:44:40 GMT):
Function name(

sbalikondwar (Wed, 11 Nov 2020 11:44:46 GMT):
paramer,

sbalikondwar (Wed, 11 Nov 2020 11:44:50 GMT):
)

sbalikondwar (Wed, 11 Nov 2020 11:44:53 GMT):
returns

sbalikondwar (Thu, 12 Nov 2020 12:37:18 GMT):
i have updated the pr

sbalikondwar (Thu, 12 Nov 2020 12:37:21 GMT):
please check

sbalikondwar (Thu, 12 Nov 2020 12:37:35 GMT):
will go for a short break in the meanwhile

seanyoung (Thu, 12 Nov 2020 12:38:37 GMT):
I'm checking out the pr

seanyoung (Thu, 12 Nov 2020 12:38:40 GMT):
looks great so far!

seanyoung (Fri, 13 Nov 2020 15:51:35 GMT):
@sbalikondwar I have created https://github.com/hyperledger-labs/solang/pull/318 what do you think? I'm open to suggestions of course, it is your code. This updates the language server to the latest AST, and makes sure that the language server is included in the solang binary for windows/mac/linux.

sbalikondwar (Fri, 13 Nov 2020 15:52:37 GMT):
I'll have a look

seanyoung (Fri, 13 Nov 2020 15:52:42 GMT):
Thansk

seanyoung (Fri, 13 Nov 2020 15:52:42 GMT):
Thanks

sbalikondwar (Fri, 13 Nov 2020 15:53:02 GMT):
There is some packaging part remaining of the implementation

sbalikondwar (Fri, 13 Nov 2020 15:53:36 GMT):
And a documentation update

seanyoung (Fri, 13 Nov 2020 15:54:17 GMT):
For the packaging part, I thought it could tell users to install the solang binary in their path

sbalikondwar (Fri, 13 Nov 2020 15:57:13 GMT):
Yeah exactly thats what I am also thinking

seanyoung (Sat, 14 Nov 2020 13:10:47 GMT):
@sbalikondwar I had an idea what we could do with the extension. Of course, this is a suggestion, it's your code. We could put the TypeScript extension code in the solang repo under /vscode and merge the solang-server code with the solang binary. So then everything is in one repo, and the extension gets more visibility as the solang repo has more stars etc. We can add you as a maintainer to the solang repo so you can help maintain it

sbalikondwar (Sat, 14 Nov 2020 13:17:52 GMT):
Sounds interesting

sbalikondwar (Sat, 14 Nov 2020 13:18:04 GMT):
I'll have to check the code for the implementation and all

sbalikondwar (Sat, 14 Nov 2020 13:18:27 GMT):
I'll get back to you when I check it

seanyoung (Sat, 14 Nov 2020 13:31:30 GMT):
Ok let me know what you think

sbalikondwar (Mon, 16 Nov 2020 06:51:52 GMT):
sean i looked at the PR the code looks good but i wanted to check if i can hook it with installable vsix

sbalikondwar (Mon, 16 Nov 2020 06:52:05 GMT):
i pulled and compiled but i am getting some error

sbalikondwar (Mon, 16 Nov 2020 06:52:06 GMT):
Compiling solang v0.1.5 (/home/hyperion/intern/hyperledger/solang-sls/solang) The following warnings were emitted during compilation: warning: src/linker/linker.cpp:2:10: fatal error: lld/Common/Driver.h: No such file or directory warning: 2 | #include "lld/Common/Driver.h" warning: | ^~~~~~~~~~~~~~~~~~~~~ warning: compilation terminated. error: failed to run custom build command for `solang v0.1.5 (/home/hyperion/intern/hyperledger/solang-sls/solang)` Caused by: process didn't exit successfully: `/home/hyperion/intern/hyperledger/solang-sls/solang/target/debug/build/solang-2080b50cae458103/build-script-build` (exit code: 1) --- stdout cargo:rerun-if-changed=./src/parser/solidity.lalrpop TARGET = Some("x86_64-unknown-linux-gnu") OPT_LEVEL = Some("0") HOST = Some("x86_64-unknown-linux-gnu") CXX_x86_64-unknown-linux-gnu = None CXX_x86_64_unknown_linux_gnu = None HOST_CXX = None CXX = None CXXFLAGS_x86_64-unknown-linux-gnu = None CXXFLAGS_x86_64_unknown_linux_gnu = None HOST_CXXFLAGS = None CXXFLAGS = None CRATE_CC_NO_DEFAULTS = None DEBUG = Some("true") CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-Wno-unused-parameter" "-I/usr/lib/llvm-10/include" "-std=c++14" "-fno-exceptions" "-D_GNU_SOURCE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-o" "/home/hyperion/intern/hyperledger/solang-sls/solang/target/debug/build/solang-9bce24589ae04c73/out/src/linker/linker.o" "-c" "src/linker/linker.cpp" cargo:warning=src/linker/linker.cpp:2:10: fatal error: lld/Common/Driver.h: No such file or directory cargo:warning= 2 | #include "lld/Common/Driver.h" cargo:warning= | ^~~~~~~~~~~~~~~~~~~~~ cargo:warning=compilation terminated. exit code: 1 --- stderr error occurred: Command "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-Wall" "-Wextra" "-Wno-unused-parameter" "-I/usr/lib/llvm-10/include" "-std=c++14" "-fno-exceptions" "-D_GNU_SOURCE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-o" "/home/hyperion/intern/hyperledger/solang-sls/solang/target/debug/build/solang-9bce24589ae04c73/out/src/linker/linker.o" "-c" "src/linker/linker.cpp" with args "c++" did not execute successfully (status code exit code: 1).

sbalikondwar (Mon, 16 Nov 2020 07:14:43 GMT):
ok i have solved the compilation issue

sbalikondwar (Mon, 16 Nov 2020 07:15:01 GMT):
how should i use the langserver any args?

seanyoung (Mon, 16 Nov 2020 09:06:53 GMT):
@sbalikondwar good morning solang now uses the lld linker as a library. You can try installing the `liblld-10-dev` package, or downloading the llvm tar.gz from here https://solang.readthedocs.io/en/latest/installing.html#installing-llvm-on-linux

seanyoung (Mon, 16 Nov 2020 09:07:43 GMT):
good morning `solang --language-server` should be enough

sbalikondwar (Mon, 16 Nov 2020 09:35:01 GMT):
I tried your pr with my packaged exten

sbalikondwar (Mon, 16 Nov 2020 09:35:01 GMT):
I tried your pr with my packaged extension

sbalikondwar (Mon, 16 Nov 2020 09:35:44 GMT):
And its running good so I think we can merge that pr

seanyoung (Mon, 16 Nov 2020 09:36:01 GMT):
That's great, thank you.

sbalikondwar (Mon, 16 Nov 2020 09:36:21 GMT):
Yeah well I'll update my Solang vscode repo when I get back

seanyoung (Mon, 16 Nov 2020 09:37:14 GMT):
What do you think about the typescript extension code? Would you like it to remain in solang-vscode, or merged into solang? Whatever repo you decide, you can become a github maintainer of it.

sbalikondwar (Mon, 16 Nov 2020 09:38:50 GMT):
That's good, let's keep it in Solang itself as a sub project or folder

sbalikondwar (Mon, 16 Nov 2020 09:38:50 GMT):
That's good, let's keep it in Solang itself as a sub project or folder Well I am still a bit confused

sbalikondwar (Mon, 16 Nov 2020 09:39:41 GMT):
About the organisation and all

seanyoung (Mon, 16 Nov 2020 09:44:46 GMT):
so I was thinking we could have a /vscode directory in solang with the extension code. Then we merge the documentation for the extension with solang's documentation

seanyoung (Mon, 16 Nov 2020 09:45:02 GMT):
existing solang-vscode repo would tell users to go to solang

seanyoung (Mon, 16 Nov 2020 09:45:10 GMT):
you become a maintainer of solang repo

seanyoung (Mon, 16 Nov 2020 09:45:19 GMT):
and then we maintain the extension together

seanyoung (Mon, 16 Nov 2020 09:45:48 GMT):
(by consencus)

seanyoung (Mon, 16 Nov 2020 09:56:21 GMT):
otherwise, we keep the typescript in solang-vscode repo and maintain the typescript there

sbalikondwar (Mon, 16 Nov 2020 10:03:51 GMT):
Ok I think keeping everything related at one place should be fine

sbalikondwar (Mon, 16 Nov 2020 10:04:24 GMT):
So yes let's keep it inside vscode folder and migrate it there

sbalikondwar (Mon, 16 Nov 2020 10:04:33 GMT):
Why should we maintain two repos

seanyoung (Mon, 16 Nov 2020 10:05:16 GMT):
Exactly, two repos is more work, and confusing to users

sbalikondwar (Mon, 16 Nov 2020 10:05:28 GMT):
Yeah ok

sbalikondwar (Mon, 23 Nov 2020 13:32:34 GMT):
good afternoon

seanyoung (Mon, 23 Nov 2020 13:48:00 GMT):
good afternoon

sbalikondwar (Tue, 24 Nov 2020 09:46:39 GMT):
I have some docs written

sbalikondwar (Tue, 24 Nov 2020 09:46:42 GMT):
take a look

seanyoung (Tue, 24 Nov 2020 09:46:55 GMT):
Great!

sbalikondwar (Tue, 24 Nov 2020 09:48:11 GMT):
wait can't i send html files in rocketcha

sbalikondwar (Tue, 24 Nov 2020 09:48:11 GMT):
wait can't i send html files in rocketchat

sbalikondwar (Tue, 24 Nov 2020 09:48:59 GMT):

intro.pdf

sbalikondwar (Tue, 24 Nov 2020 09:49:38 GMT):

development.pdf

sbalikondwar (Tue, 24 Nov 2020 09:50:28 GMT):

diagnostics.pdf

sbalikondwar (Tue, 24 Nov 2020 09:50:32 GMT):

hover.pdf

sbalikondwar (Tue, 24 Nov 2020 09:50:42 GMT):
let me know

sbalikondwar (Tue, 24 Nov 2020 09:51:23 GMT):
I will integrate it inside docs file in solang

seanyoung (Tue, 24 Nov 2020 09:55:13 GMT):
I would start with "Solang Vscode Extension"

seanyoung (Tue, 24 Nov 2020 09:56:41 GMT):
I'm not sure the vsix file should be called slang-ex.vsix. It's an extension already so need for "-ex". "slang" could "solang". We can revisit this at a later time.

sbalikondwar (Tue, 24 Nov 2020 09:57:04 GMT):
yes i have changes the vsix name

sbalikondwar (Tue, 24 Nov 2020 09:57:04 GMT):
yes i have changed the vsix name

seanyoung (Tue, 24 Nov 2020 09:57:24 GMT):
the solang binary should be in the path somewhere, and if the user does not have ~/.cargo/bin in their $PATH variable, then copying solang to ~/.cargo/bin won't work

seanyoung (Tue, 24 Nov 2020 09:57:24 GMT):
the solang binary should be in the path somewhere, and if the user does not have `~/.cargo/bin` in their $PATH variable, then copying solang to `~/.cargo/bin` won't work

sbalikondwar (Tue, 24 Nov 2020 09:57:44 GMT):
yes

sbalikondwar (Tue, 24 Nov 2020 09:57:57 GMT):
ok i will look into that

seanyoung (Tue, 24 Nov 2020 09:58:11 GMT):
otherwise I think it looks great

seanyoung (Tue, 24 Nov 2020 12:55:37 GMT):
@sbalikondwar is your plan to add it to the documentation at https://solang.readthedocs.io/ ? In that case it needs to be written in restructuredtext (rst) at https://github.com/hyperledger-labs/solang/tree/master/docs You can generate the documentation locally with `make html` in the docs directory

sbalikondwar (Tue, 24 Nov 2020 13:13:40 GMT):
I thought to add as a markdown

sbalikondwar (Tue, 24 Nov 2020 13:14:02 GMT):
But yeah now I think it should be in rst or I shall use some converter

sbalikondwar (Tue, 24 Nov 2020 13:14:42 GMT):
From markdown to rst

seanyoung (Tue, 24 Nov 2020 13:17:20 GMT):
I shouldn't take long to convert to rst from markdown

seanyoung (Tue, 24 Nov 2020 13:19:07 GMT):
https://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html

seanyoung (Tue, 24 Nov 2020 13:19:29 GMT):
I've written a lot of rst so I'm happy to do the conversion if you send me the markdown

sbalikondwar (Tue, 24 Nov 2020 13:20:43 GMT):
Alright

sbalikondwar (Fri, 27 Nov 2020 11:33:35 GMT):
let serverCommand = expandPathResolving('~/.cargo/bin/solang');

sbalikondwar (Fri, 27 Nov 2020 11:34:06 GMT):
https://github.com/tremor-rs/tremor-vscode/blob/main/client/src/extension.ts#L14

sbalikondwar (Fri, 27 Nov 2020 11:35:36 GMT):
https://github.com/tremor-rs/tremor-vscode/blob/main/package.json#L39

sbalikondwar (Fri, 27 Nov 2020 11:36:37 GMT):
https://github.com/tremor-rs/tremor-vscode#configuration

KiChjang (Sat, 28 Nov 2020 02:48:19 GMT):
hello, i'm trying to implement integer overflow, and right now i'm trying to figure out if i can determine the sign from `IntValue` or `IntType`, and it looks like it's impossible?

KiChjang (Sat, 28 Nov 2020 02:48:19 GMT):
hello, i'm trying to implement integer overflow, and right now i'm trying to figure out if i can determine the signedness from `IntValue` or `IntType`, and it looks like it's impossible?

seanyoung (Sat, 28 Nov 2020 18:05:03 GMT):
The llvm IR, types are not signed/unsigned, only instructions are signed/unsigned

seanyoung (Sat, 28 Nov 2020 18:08:07 GMT):
So, no by definition `IntValue` and `IntType` cannot tell you that. However, the original types should be able to tell you that. In the emitter, you can get the signed from the Expression, something like `left.ty().is_signed_int()`

seanyoung (Thu, 03 Dec 2020 19:21:59 GMT):
https://marketplace.visualstudio.com/items?itemName=solang.solang

seanyoung (Thu, 03 Dec 2020 20:01:54 GMT):
Solang could really do with a logo. I have no idea about logos

sbalikondwar (Fri, 18 Dec 2020 14:27:14 GMT):
Yeah sounds good

KiChjang (Thu, 07 Jan 2021 09:22:54 GMT):
hrm... so the `llvm.sadd.with.overflow.i8` instruction returns an `i8` instead of the expected `{i8, i1}`... what gives?

KiChjang (Thu, 07 Jan 2021 09:22:54 GMT):
hrm... so the `llvm.sadd.with.overflow.i8` function returns an `i8` instead of the expected `{i8, i1}`... what gives?

seanyoung (Thu, 07 Jan 2021 10:54:54 GMT):
I'm confused. The documentation says https://releases.llvm.org/10.0.0/docs/LangRef.html#llvm-sadd-with-overflow-intrinsics it returns i8, i1.

seanyoung (Thu, 07 Jan 2021 10:55:47 GMT):
The bits I can find in the llvm source code also suggest this. What makes you think it returns i8?

KiChjang (Thu, 07 Jan 2021 10:56:19 GMT):
thread 'substrate_tests::expressions::unsigned_overflow' panicked at 'Found IntValue(IntValue { int_value: Value { name: "", address: 0x7f2d14030998, is_const: false, is_null: false, is_undef: false, llvm_value: " %1 = call i8 @llvm.uadd.with.overflow.i8(i8 %0, i8 1)", llvm_type: "i8" } }) but expected a different variant', /home/keith/.cargo/registry/src/github.com-1ecc6299db9ec823/inkwell-0.1.0-llvm10sample/src/values/enums.rs:365:13

seanyoung (Thu, 07 Jan 2021 11:00:37 GMT):
```%1 = call i8 @llvm.uadd.with.overflow.i8(i8 %0, i8 1)``` Should this not be: %1 = call {i8, i1} @llvm.uadd.with.overflow.i8(i8 %0, i8 1)

seanyoung (Thu, 07 Jan 2021 11:00:37 GMT):
```%1 = call i8 @llvm.uadd.with.overflow.i8(i8 %0, i8 1)``` Should this not be: %1 = call {i8, i1} @llvm.uadd.with.overflow.i8(i8 %0, i8 1)```

seanyoung (Thu, 07 Jan 2021 11:00:37 GMT):
```%1 = call i8 @llvm.uadd.with.overflow.i8(i8 %0, i8 1)``` Should this not be: ```%1 = call {i8, i1} @llvm.uadd.with.overflow.i8(i8 %0, i8 1)```

seanyoung (Thu, 07 Jan 2021 11:00:37 GMT):
`%1 = call i8 @llvm.uadd.with.overflow.i8(i8 %0, i8 1)` Should this not be: `%1 = call {i8, i1} @llvm.uadd.with.overflow.i8(i8 %0, i8 1)`

KiChjang (Thu, 07 Jan 2021 13:00:22 GMT):
it should, which is why it's puzzling to me why it isn't

KiChjang (Thu, 07 Jan 2021 13:00:47 GMT):
am i constructing the function call in the wrong way?

KiChjang (Thu, 07 Jan 2021 13:01:43 GMT):
oh yes, i definitely am, i found my mistake

KiChjang (Thu, 07 Jan 2021 13:01:53 GMT):
``` self.module .add_function(&name, ty.fn_type(&[ty.into(), ty.into()], false), None) ```

KiChjang (Thu, 07 Jan 2021 13:01:53 GMT):
``` self.module.add_function(&name, ty.fn_type(&[ty.into(), ty.into()], false), None) ```

KiChjang (Thu, 07 Jan 2021 13:03:27 GMT):
`ty` here is an `IntType`; it needs to instead be a `StructType` when calling `fn_type`

KiChjang (Thu, 07 Jan 2021 13:22:43 GMT):
okay, i'm trying to create test cases for multiplication overflow, and apparently solidity automatically converts the result of two `int8` types into a `int16` type

KiChjang (Thu, 07 Jan 2021 13:23:12 GMT):
if this is what it really does, how am i able to force an overflow/underflow?

seanyoung (Thu, 07 Jan 2021 14:51:07 GMT):
I'm not entirely following. What does the solidity look like?

KiChjang (Thu, 07 Jan 2021 23:06:33 GMT):
this contract: ``` contract overflow { function foo(int8 x) internal { int8 y = x * 64; } function bar() public { foo(8); } } ```

KiChjang (Thu, 07 Jan 2021 23:06:33 GMT):
this contract: ``` contract overflow { function foo(int8 x) internal { int8 y = x * 64; } function bar() public { foo(8); } } ```

KiChjang (Thu, 07 Jan 2021 23:06:33 GMT):
this contract: ``` contract overflow { function foo(int8 x) internal { int8 y = x * 64; } function bar() public { foo(8); } } ```

KiChjang (Thu, 07 Jan 2021 23:07:10 GMT):
yields the following error:

KiChjang (Thu, 07 Jan 2021 23:13:33 GMT):
`test.sol:4:22-23: error: implicit conversion would truncate from int16 to int8`

KiChjang (Thu, 07 Jan 2021 23:14:28 GMT):
so this is making me think that it's possible that the resultant type of `int8 * int8` is `int16`

KiChjang (Thu, 07 Jan 2021 23:14:28 GMT):
so this is making me think that it's possible that the resultant type of `int8 * int8` is `int16`, since i have never declared `int16` anywhere in the contract

seanyoung (Fri, 08 Jan 2021 11:08:21 GMT):

Clipboard - January 8, 2021 11:07 AM

seanyoung (Fri, 08 Jan 2021 11:08:37 GMT):
So I've just finished the constant folding pass for solang. This folds constant expressions using reaching definitions. This means that a call to e.g. `keccak256("foobar")` is now calculated at compile time, which can be a big win. Also, the folded constants are available to the language server. See example above.

seanyoung (Fri, 08 Jan 2021 11:10:30 GMT):

Clipboard - January 8, 2021 11:10 AM

seanyoung (Fri, 08 Jan 2021 11:10:34 GMT):
Here is an example with a hash function.

seanyoung (Fri, 08 Jan 2021 11:14:51 GMT):
This is a bug in solang. I'm investigating

seanyoung (Fri, 08 Jan 2021 11:15:02 GMT):
It should not give this error

seanyoung (Fri, 08 Jan 2021 15:20:11 GMT):
Hmm, this is broken. You can work around this issue like so: ``` contract overflow { function foo(int8 x) internal { int8 y = x * int8(64); } function bar() public { foo(8); } } ``` Obviously this will need a fix. I'm working on this.

seanyoung (Wed, 13 Jan 2021 09:22:40 GMT):
@KiChjang you might be interested in this commit https://github.com/hyperledger-labs/solang/commit/58c0ac9c4cec9e8eb3e67120852610d54e0fdd31

KiChjang (Wed, 13 Jan 2021 10:16:41 GMT):
oh i didn't know you can do that!

KiChjang (Wed, 13 Jan 2021 10:17:13 GMT):
certainly an improvement over saving to stack and loading it

KiChjang (Wed, 13 Jan 2021 12:55:43 GMT):
i was searching for `extractvalue` in the inkwell docs and didn't find anything

KiChjang (Wed, 13 Jan 2021 12:56:07 GMT):
it didn't occur to me that i should've searched for `extract_value` instead

seanyoung (Wed, 13 Jan 2021 12:56:21 GMT):
the inkwell documentation isn't great for understanding the llvm ir

KiChjang (Wed, 13 Jan 2021 12:56:46 GMT):
i knew there was an instruction for this, i just wasn't sure if inkwell had it

lesterli (Mon, 25 Jan 2021 13:49:58 GMT):
Has joined the channel.

lesterli (Mon, 25 Jan 2021 13:49:58 GMT):
Hello Sean, this is Lester.

seanyoung (Mon, 25 Jan 2021 13:57:37 GMT):
Hello Lester!

seanyoung (Mon, 25 Jan 2021 13:57:47 GMT):
Interesting to meet you

lesterli (Mon, 25 Jan 2021 14:01:22 GMT):
I am glad to meet you.

seanyoung (Mon, 25 Jan 2021 18:05:13 GMT):
@lester I'm interested in what you would like to use smartcontracts in bandot for. Are you going to be writing smart contracts yourself, or is this for your users to write smart contracts?

seanyoung (Mon, 25 Jan 2021 18:05:13 GMT):
@lesterli I'm interested in what you would like to use smartcontracts in bandot for. Are you going to be writing smart contracts yourself, or is this for your users to write smart contracts?

seanyoung (Mon, 25 Jan 2021 18:08:21 GMT):
@all there is a bounty 400 DAI (=400 USD) bounty for an enhancement for the solang vscode extension. https://github.com/hyperledger-labs/solang/issues/361 See let me know if you have any questions.

seanyoung (Mon, 25 Jan 2021 18:08:21 GMT):
@all there is a 400 DAI (=400 USD) bounty for an enhancement for the solang vscode extension. https://github.com/hyperledger-labs/solang/issues/361 See let me know if you have any questions.

TingALin (Tue, 26 Jan 2021 00:21:31 GMT):
Has joined the channel.

TingALin (Tue, 26 Jan 2021 00:21:32 GMT):
@seanyoung I will do the answering for lester, we will be mostly using our users smart contracts and probably one or two of our own. thanks for the links and we will keep you posted on our project status.

seanyoung (Tue, 26 Jan 2021 10:53:18 GMT):
Great, thanks. For your own contracts, would you like to write those contracts in Solidity? Do you have existing code or is this new code?

seanyoung (Tue, 26 Jan 2021 10:53:48 GMT):
So I am looking for someone I can help run their Solidity code using solang

sbalikondwar (Sat, 30 Jan 2021 09:33:33 GMT):
Good morning

seanyoung (Sat, 30 Jan 2021 09:53:50 GMT):
Hello

seanyoung (Thu, 04 Feb 2021 15:47:15 GMT):
Solang v0.1.7 has been released: https://github.com/hyperledger-labs/solang/releases/tag/v0.1.7

seanyoung (Tue, 16 Feb 2021 12:54:20 GMT):
A new version of the solang extension has been released which downloads the compiler binary automagically

sbalikondwar (Wed, 17 Feb 2021 19:07:35 GMT):
i see the code has been merged :woo:

sbalikondwar (Wed, 17 Feb 2021 19:19:01 GMT):
the download implementation is quite interesting, the person seems to have had prior exp on ts.

seanyoung (Thu, 18 Feb 2021 10:33:01 GMT):
Yes, the code looks pretty good. It does not download any updates when a new version is released. I'll try to add that next time we do a release

ggueyraud (Fri, 19 Feb 2021 08:23:57 GMT):
Has joined the channel.

ggueyraud (Fri, 19 Feb 2021 08:23:57 GMT):
Hi everyone, I currently try to use Solang to compile Solidity and send the output throw web3. The sending part work perfectly like open wasm file, encode as hex, prefix hex output with 0x and send that with .abi generated file. So the problem is when I need to use the deployed contract, I have an error like => Error: Abi(InvalidName("please ensure the contract and method you\'re calling exist! failed to decode empty bytes. if you\'re using jsonrpc this is likely due to jsonrpc returning `0x` in case contract or method don\'t exist")) This problem doesn't exist when I just "traditional" method with solc compiler and sending .bin and .abi files, if someone has an idea I really appreciate Thanks guys !

seanyoung (Fri, 19 Feb 2021 14:47:47 GMT):
Hi @ggueyraud what blockchain are you using? Ethereum?

seanyoung (Fri, 19 Feb 2021 14:48:41 GMT):
how exactly are you sending it? some example code would be perfect

LamLe (Sun, 02 May 2021 13:16:22 GMT):
Has joined the channel.

LamLe (Sun, 02 May 2021 13:20:24 GMT):
hello, good morning, I am trying to build solang --target solana flipper.sol but I got this error message "LLVM ERROR: unable to allocate function return #1 [1] 53154 abort solang --target solana flipper.sol" I am using macOS Mojave solang 0.1.7 cargo 1.51.0 llvm11.0 Thanks

seanyoung (Tue, 04 May 2021 16:54:30 GMT):
Hi @LamLe You'll need to use a build of llvm with the solana patches. See here https://solang.readthedocs.io/en/latest/installing.html#installing-llvm-on-mac

lucasste (Mon, 10 May 2021 14:47:23 GMT):
Has joined the channel.

lucasste (Mon, 10 May 2021 14:47:24 GMT):
Hello everyone. Does Solang have an implementation of SSA (Stating Single Assignment) for code optimization?

lucasste (Mon, 10 May 2021 14:47:24 GMT):
Hello everyone. Does Solang have an implementation of SSA (Static Single Assignment) for code optimization?

seanyoung (Tue, 11 May 2021 22:35:14 GMT):
Hi @lucasste When solang generates code, it has its own intermediate representation called CFG. This is not SSA. However, when we generate llvm IR has to be SSA, so conversion to SSA is done during the emit phase. There is something to be said for the CFG to already be CFG. I think this would be a nice addition but would require some work.

sbalikondwar (Wed, 02 Jun 2021 10:20:40 GMT):
Hi there

sbalikondwar (Wed, 02 Jun 2021 10:20:59 GMT):
I see hyperledger mentorship has started this year

seanyoung (Thu, 03 Jun 2021 12:14:51 GMT):
Hi yes, @lucasste will be working on new compiler passes this year.

seanyoung (Mon, 07 Jun 2021 09:15:18 GMT):
@lucasste you might be interesting in this https://cfallin.org/blog/2020/09/18/cranelift-isel-1/ The section titled "Backward Pass with Use-Counts" describes how to remove unused variables during codegen, without additional passes. I thought the entire blog post is very interesting; it talks about how to do codegen with much fewer passes than a traditional compiler design.

lucasste (Wed, 09 Jun 2021 15:09:02 GMT):
Thanks @seanyoung ! I will take a look.

sbalikondwar (Wed, 09 Jun 2021 15:09:23 GMT):
Nice let me know @lucasste if you require any help

sbalikondwar (Wed, 09 Jun 2021 15:09:52 GMT):
I worked on the project last year

lucasste (Wed, 09 Jun 2021 15:10:33 GMT):
We have a symbol table for each function. Is there a symbol table for the contract itselft?

sbalikondwar (Wed, 09 Jun 2021 15:11:44 GMT):
Yes the contract has function table inside it, so image contract as a superset am I right @seanyoung

lucasste (Wed, 09 Jun 2021 15:12:48 GMT):
I am looking into where we account for a contract's variables (attributes)

sbalikondwar (Wed, 09 Jun 2021 15:15:04 GMT):
You can try using grep tool, it helped me a lot to search for keywords in code

seanyoung (Wed, 09 Jun 2021 15:16:25 GMT):
So each function does have a symbol table for the local variables, but non-locals are not stored in the function symbol table. For the "global" scope (as in non-local functions) there are two symbol tables. One for functions, and one for the rest. This symbol table is in `Namespace`. `function_symbols` and `variable_symbols`. That last one should really be called non-functions_symbols.

seanyoung (Wed, 09 Jun 2021 15:16:25 GMT):
So each function does have a symbol table for the local variables, but non-locals are not stored in the function symbol table. For the "global" scope (as in non-local functions) there are two symbol tables. One for functions, and one for the rest. This symbol table is in `Namespace`. `function_symbols` and `variable_symbols`. That last one should really be called non-functions_symbols. See https://github.com/hyperledger-labs/solang/blob/main/src/sema/ast.rs#L348

seanyoung (Wed, 09 Jun 2021 15:16:25 GMT):
So each function does have a symbol table for the local variables, but non-locals are not stored in the function symbol table. For the "global" scope (as in non-local symbols) there are two symbol tables. One for functions, and one for the rest. This symbol table is in `Namespace`. `function_symbols` and `variable_symbols`. That last one should really be called non-functions_symbols. See https://github.com/hyperledger-labs/solang/blob/main/src/sema/ast.rs#L348

seanyoung (Wed, 09 Jun 2021 15:17:01 GMT):
Note that symbol can exist in a contract or in the file scope.

seanyoung (Wed, 09 Jun 2021 15:17:29 GMT):
You can declare a struct in side a contract, or outside of a contract.

seanyoung (Wed, 09 Jun 2021 15:18:34 GMT):
Solidity has some strangeness where the same name can refer to a function or a variable, depending on context, that's why there are two symbol tables.

seanyoung (Wed, 09 Jun 2021 15:21:01 GMT):
BTW on the cranelift posting: I have since learnt that firefox uses cranelift for executing wasm, and it's much faster than chrome. Many projects are switching to cranelift for wasm execution, due to the clever tricks they have done there. Substrate is now also using cranelift.

lucasste (Wed, 09 Jun 2021 15:40:31 GMT):
For the global variables, `variable_symbols` is a hash table that maps the file number, contract and identifier to the `enum Symbol`. Do we store data about these variables somewhere?

seanyoung (Wed, 09 Jun 2021 16:01:03 GMT):
So variables themselves can exists in contracts, constants can exists in contracts as well as the global scope. They in the Variable structure, which is stored in Namespace variables and Contracts variables.

seanyoung (Wed, 09 Jun 2021 16:02:15 GMT):
Constants are just variables with constant set and they always should have an initializer.

lucasste (Thu, 10 Jun 2021 00:13:50 GMT):
Cam I backtrack the position of the variable in the file using the `Identifier` struct (defined in `parser/pt.rs`)? I remember that we talked about it.

lucasste (Thu, 10 Jun 2021 00:14:50 GMT):
I was thinking how difficult would it be to print a complete warning when a variable is unused like those we see in gcc.

seanyoung (Thu, 10 Jun 2021 10:18:57 GMT):
Yes, the `Identifier` struct includes a `loc` which tells you what file and begin/end offsets. So, you can use that for a complete warning.

seanyoung (Thu, 10 Jun 2021 10:20:41 GMT):
In fact, such an warning would be stored in the `Diagnostic` struct. This goes in into the `diagnostic` vector of `Namespace`.

seanyoung (Thu, 10 Jun 2021 10:21:07 GMT):
You just need the a copy of the `loc` to generate a diagnostic.

lucasste (Fri, 11 Jun 2021 12:37:42 GMT):
Do I need Clang to compile LLVM?

lucasste (Fri, 11 Jun 2021 14:44:17 GMT):
It took me two hours to build LLVM 😅

lucasste (Fri, 11 Jun 2021 15:03:09 GMT):
Solang succesfully compiled ✅

seanyoung (Fri, 11 Jun 2021 15:52:31 GMT):
Great!

lucasste (Mon, 14 Jun 2021 10:26:57 GMT):
To detect an unused variable, should I add a boolean to the struct `Variable` or should I count the number of references? I am thinking of using only a boolean right now.

lucasste (Mon, 14 Jun 2021 10:28:14 GMT):
I am planning to update the `used` parameter inside the `pub fn expression` in `sema/expression.rs`

lucasste (Mon, 14 Jun 2021 10:48:50 GMT):
Suppose that I have `unint32 a;` and `a = x + y;`, but then `a` is never used in any other instruction. Should I detect that `a` has been assigned but never used?

seanyoung (Mon, 14 Jun 2021 11:04:58 GMT):
Good question, I was wondering whether it should be a counter or a boolean too. 1) I don't thinking a counter adds any runtime cost, so there is no performance reason for choosing one of the other 2) We are actually only interested in whether it used or not, not the usage count. So, the data model should reflect that. So I think it should be a `bool`. 3) Should we at some point need a usage count, then changing the `bool` to `usize` will not take long. So, choosing one of the other is not going to cost us much in the future.

lucasste (Mon, 14 Jun 2021 11:06:35 GMT):
My concern is that a counter may overflow if we have too many references

seanyoung (Mon, 14 Jun 2021 11:06:59 GMT):
That's true too.

seanyoung (Mon, 14 Jun 2021 11:07:19 GMT):
However in this case it would have to be a very large program for that to happen

lucasste (Mon, 14 Jun 2021 11:09:29 GMT):
I remember you mentioned that variables may be recursively unused (`a=b`, if `a` is never used, then `b` is also never used). Should I be worrying about that? If so, I was thinking that I may need to build a dependency graph and do a topological sorting to detect so.

lucasste (Mon, 14 Jun 2021 11:09:41 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=uv3Ex8yWHJroYYQfj) @seanyoung

lucasste (Mon, 14 Jun 2021 11:11:42 GMT):
I did some tests this morning to find where I can detect that a variable has been assigned and where a variable is referenced. https://github.com/LucasSte/solang/commit/69e546376979092702f11de73e5f9db133103279

lucasste (Mon, 14 Jun 2021 11:11:59 GMT):
In the afternoon, I will deep dive more into that

seanyoung (Mon, 14 Jun 2021 11:16:53 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=3LfLB9ng2bvDZFKZ9) Let's solve the simpler case first. This is a nice to have, not necessary.

seanyoung (Mon, 14 Jun 2021 11:17:56 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=572iCFyB8xH8bwJa7) Perfect, that's a good way to start.

lucasste (Tue, 15 Jun 2021 09:59:29 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=uv3Ex8yWHJroYYQfj) What about this?

seanyoung (Tue, 15 Jun 2021 10:38:14 GMT):
@lucasste yes, it should.

seanyoung (Tue, 15 Jun 2021 10:39:50 GMT):
There is a more complex variant of this: ``` int a; a = x + y; a = z * 3; foo(a); ``` Here the first assignment `x + y` is unused. I think this type of unused can only be solved by using reaching definitions; so don't worry about this for mow.

seanyoung (Tue, 15 Jun 2021 10:39:50 GMT):
There is a more complex variant of this: ``` int a; a = x + y; a = z * 3; foo(a); ``` Here the first assignment `x + y` is unused. I think this type of unused can only be solved by using reaching definitions; so don't worry about this for now.

lucasste (Tue, 15 Jun 2021 14:35:03 GMT):
I was thinking that detecting read and assigned variables would be a good idea for more constructive warnings. Do you think I should consider unused only never referenced variables? My understanding is that if a variable is assigned but never used, I should also raise a warning.

lucasste (Tue, 15 Jun 2021 14:35:03 GMT):
I was thinking that detecting read and assigned variables would be a good idea for more constructive warnings. Do you think I should only consider unused never referenced variables? My understanding is that if a variable is assigned but never read, I should also raise a warning.

lucasste (Tue, 15 Jun 2021 14:36:55 GMT):
I am detecting assigned variables when there is an assign expression and read variables all those that appear on the right side of the assignment.

lucasste (Tue, 15 Jun 2021 14:36:55 GMT):
I am detecting assigned variables when there is an assign expression. Read variables are all those that appear on the right side of an assignment.

seanyoung (Tue, 15 Jun 2021 17:48:36 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=rzGNRAFLpPCvhbQqA) I think that would be nice to have, certainly

lucasste (Wed, 16 Jun 2021 15:04:33 GMT):
Is there a symbol table for contracts? I found here that contract variables are saved in `pub variables: Vec` inside `pub struct Contract` defined in `sema/ast.rs`

lucasste (Wed, 16 Jun 2021 15:12:05 GMT):
For variables inside a function, which are saved in the symbol table, I am thinking of modifying the struct `Variable` to this: `pub struct Variable { pub id: pt::Identifier, pub ty: Type, pub pos: usize, pub slice: bool, pub assigned: bool, pub used: bool, pub function_dependent: bool, }`

lucasste (Wed, 16 Jun 2021 15:12:05 GMT):
For variables inside a function, which are saved in the symbol table, I am thinking of modifying the struct `Variable` to this: ` pub struct Variable { pub id: pt::Identifier, pub ty: Type, pub pos: usize, pub slice: bool, pub assigned: bool, pub used: bool, pub function_dependent: bool, } `

lucasste (Wed, 16 Jun 2021 15:12:05 GMT):
For variables inside a function, which are saved in the symbol table, I am thinking of modifying the struct `Variable` to this:

lucasste (Wed, 16 Jun 2021 15:13:17 GMT):
pub struct Variable { pub id: pt::Identifier, pub ty: Type, pub pos: usize, pub slice: bool, pub assigned: bool, pub used: bool, pub function_dependent: bool, }

lucasste (Wed, 16 Jun 2021 15:13:17 GMT):
pub struct Variable { pub id: pt::Identifier, pub ty: Type, pub pos: usize, pub slice: bool, pub assigned: bool, pub read: bool, pub function_dependent: bool, }

lucasste (Wed, 16 Jun 2021 15:13:17 GMT):
````pub struct Variable { pub id: pt::Identifier, pub ty: Type, pub pos: usize, pub slice: bool, pub assigned: bool, pub read: bool, pub function_dependent: bool, } ```

lucasste (Wed, 16 Jun 2021 15:13:45 GMT):
(I couldn't figure out how to format that in code mode)

seanyoung (Wed, 16 Jun 2021 15:14:24 GMT):
code mode is three backticks newline, then the code, then three backticks

seanyoung (Wed, 16 Jun 2021 15:15:08 GMT):
So there is a symbol table in Namespace called `function_symbols` and `variables_symbols`. Is that what you are looking for

seanyoung (Wed, 16 Jun 2021 15:15:28 GMT):
what is `function_dependent` for?

lucasste (Wed, 16 Jun 2021 15:16:24 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=rAhXSmYNkj3TzfHXi) `assgined` means that a variable has been assinged. `read` means that a variable has been read. `function_dependent` is a return variable or a function parameter (they cannot be eliminated from code, but I would like to raise warnings if they are unused).

lucasste (Wed, 16 Jun 2021 15:20:51 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=j2eh4qNT8yQPhm4Mf) I was investigating `var_decl` function in `sema/variables.rs`. It seems that contract variables are pushed into `ns.contracts[contract_no].variables`

lucasste (Wed, 16 Jun 2021 15:24:47 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=rAhXSmYNkj3TzfHXi) I would use similar structure for contract variables. In this case, `function_dependent` would not be present.

lucasste (Wed, 16 Jun 2021 15:28:17 GMT):
I am thinking of creating a new folder inside `sema` to code the functions related to unused variable detection. I think this would make the code cleaner. The folde name can be `optimizations` for I would be saving there files related to unused variable detection and undefined variable detection.

lucasste (Wed, 16 Jun 2021 15:38:14 GMT):
`pub struct Loc` has three integers. What do they mean?

lucasste (Wed, 16 Jun 2021 15:44:12 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=j2eh4qNT8yQPhm4Mf) I might be wrong, but it looks like the `variable_symbols` only saves Enums, meanwhile `ns.contracts[#].variables` hold more data about variables.

seanyoung (Wed, 16 Jun 2021 15:50:14 GMT):
I would rename `function_dependent` to `parameter_or_return`.

seanyoung (Thu, 17 Jun 2021 11:49:23 GMT):
@lucasste one clarification: the values in `pt::Loc` are file number, start offset and end offset in _bytes_ not characters.

lucasste (Mon, 21 Jun 2021 14:10:30 GMT):
In destructure statement, all variables have to be initialized?

lucasste (Mon, 21 Jun 2021 14:10:30 GMT):
In a destructure statement, all variables have to be initialized?

lucasste (Mon, 21 Jun 2021 15:07:44 GMT):
@seanyoung Why do you use a hashMap to store variables in the symbol table?

lucasste (Mon, 21 Jun 2021 15:08:11 GMT):
Why didn't you choose a vector?

lucasste (Mon, 21 Jun 2021 17:08:45 GMT):
The symbol table in function `expression` (`sema/expression.rs`) is not mutable. To modify it, I need to make it mutable in a lot of functions. Do you have any other suggestion?

seanyoung (Mon, 21 Jun 2021 17:17:10 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=RFJ8TuWtfXRKfW8PZ) In a destructure statement, all variables on the left will get a new value. Note that you can leave some fields out on the left (but not on the right).

seanyoung (Mon, 21 Jun 2021 17:19:21 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=ZERRBwDi7CfYkohZy) That could do with some explaining really. So each variable gets a unique id (see `ns.next_id`). So the symbol table isn't counting from id 0.

seanyoung (Mon, 21 Jun 2021 17:21:11 GMT):
I'm pretty sure that is done so that we can deal with modifiers. Modifiers are super weird and their code gen merges multiple modifiers into a single CFG, so the variables in the symbol table must not overlap.

seanyoung (Mon, 21 Jun 2021 17:23:44 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=Y8yMFhZSHyynt2pdE) You can either make it `&mut` which will touch a huge amount of lines or you can use `RefCell<>` this allows you have to interior mutability for structs when they're not `&mut`. This essentially punts the safety checks to runtime, so this is slower (but it shouldn't be an issue)

lucasste (Tue, 22 Jun 2021 10:47:59 GMT):
`ConstantVariable(pt::Loc, Type, Option, usize)` In ConstantVariable, is the first integer the contract number? If it is None, is the variable a local variable then?

lucasste (Tue, 22 Jun 2021 10:54:23 GMT):
How do you differentiate between constant variables declared inside a contract and those declared outside it?

seanyoung (Tue, 22 Jun 2021 22:27:39 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=eGNpaghKTAqmtfwgT) The first integer - the option - is the contract number. If the constant is declared outside of a contract, it is None

lucasste (Wed, 23 Jun 2021 14:21:45 GMT):
I am trying to find examples of `Expression::StorageBytesSubscript` and `Expression::DynamicArraySubscript`, but everything I find seems to fall into `Expression::Subscript`. Can you explain what is the difference between these types of subscripts?

lucasste (Wed, 23 Jun 2021 15:30:41 GMT):
Why did you differentiate `DynamicArrayPush` from `Builtin(.., Builtin::ArrayPush)`?

lucasste (Wed, 23 Jun 2021 17:31:31 GMT):
Is `Type::Bytes` the same thing as an array of bytes (`bytes[]`)? It this is not the case, what is it?

lucasste (Wed, 23 Jun 2021 22:54:23 GMT):
``` contract AddNumbers { function add(uint256 a, uint256 b) external returns (uint256 c) {c = a + b;} } contract Example { AddNumbers addContract; event StringFailure(string stringFailure); event BytesFailure(bytes bytesFailure); function exampleFunction(uint256 _a, uint256 _b) public returns (uint256 _c) { try addContract.add(_a, _b) returns (uint256 _value) { return (_value); } catch Error(string memory _err) { // This may occur if there is an overflow with the two numbers and the `AddNumbers` contract explicitly fails with a `revert()` emit StringFailure(_err); } catch (bytes memory _err) { emit BytesFailure(_err); } } } ```

lucasste (Wed, 23 Jun 2021 22:55:13 GMT):
This example crashes the code with the following error `thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/codegen/dead_storage.rs:326:13`

seanyoung (Thu, 24 Jun 2021 16:22:12 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=vHqLiHXHPuTg2rfRg) When `string` or `bytes` is in contract storage, subscript needs special handling. It needs chain-specific code. `Expression::DynamicArraySubscript` is for variable-length arrays (in memory, not in contract storage). `Expression::Subscript` is for other cases, fixed-length arrays which are not special.

seanyoung (Thu, 24 Jun 2021 16:22:58 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=73D2soimt3bSvqxEW) This could do with better naming, absolutely. The first is for memory arrays and the second is for contract storage. They need to be merged.

seanyoung (Thu, 24 Jun 2021 16:25:04 GMT):
As for the broken code: that needs fixing, I'll look into it.

lucasste (Mon, 28 Jun 2021 15:38:17 GMT):
I tested my code with contract inheritance.

lucasste (Mon, 28 Jun 2021 15:38:45 GMT):
It already detects the usage of variables of parent contracts in derived ones

seanyoung (Tue, 29 Jun 2021 20:34:19 GMT):
@lucasste I've fixed the miscompile issue you found this PR: https://github.com/hyperledger-labs/solang/pull/428

lucasste (Tue, 29 Jun 2021 22:12:36 GMT):
Check for global unsued variables (constants outside contracts) and contract unused variables should be done after `parse_and_resolve` finishes. But it is outside the scope of `sema`. Do you have any idea where I can do this check?

lucasste (Tue, 29 Jun 2021 22:14:44 GMT):
One solution would be creating a new `sema` function that wraps the old one and performs that checking. I cannot do it inside `fn sema` because it is executed recursively.

lucasste (Tue, 29 Jun 2021 22:14:44 GMT):
One solution would be creating a new `sema` function that wraps the old one and performs that checking. I cannot do the check inside the existing `fn sema` because it is executed recursively.

lucasste (Tue, 29 Jun 2021 22:15:38 GMT):
By the way, in what case do we have more than one namespace?

seanyoung (Thu, 01 Jul 2021 07:55:39 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=7R6waoAEmP82msHkw) This should really happen in `parse_and_resolve` if the code is in sema. There can be an extra step in `parse_and_resolve` to check for unused global constants.

seanyoung (Thu, 01 Jul 2021 07:56:12 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=7htcXETz8yts4FoLZ) Compiling one file produces one namespace. Compiling multiple files produces multiple namespaces.

lucasste (Fri, 02 Jul 2021 21:39:05 GMT):
Hey, @seanyoung . I opened a draft pull request (https://github.com/hyperledger-labs/solang/pull/429). I still have to write tests, but it would be nice if you take a look.

lucasste (Fri, 02 Jul 2021 21:39:48 GMT):
Do you usually squash your commits when merging the PR?

seanyoung (Sun, 04 Jul 2021 15:46:28 GMT):
Looks great, I've left a few minor comments. Yes, I do squash the commits before merging - a clean history is much nicer, esp when bisecting.

lucasste (Mon, 05 Jul 2021 17:07:23 GMT):
Besides the tests, do I need to write some kind of documentation for this PR?

seanyoung (Tue, 06 Jul 2021 09:31:03 GMT):
I don't think the solang project needs any documentation for this, but you should have some examples in the hyperledger wiki page: https://wiki.hyperledger.org/display/INTERN/Project+plan+-+Solang+compiler+passes+2021

lucasste (Tue, 06 Jul 2021 17:56:06 GMT):
``` contract Test { bytes byteArr; bytes32 baRR; function get() public { string memory s = "Test"; byteArr = bytes(s); uint16 a = 1; uint8 b; b = uint8(a); uint256 c; c = b; bytes32 b32; b32 = bytes32(byteArr); baRR = bytes32(c); uint i1 = 1; uint i2 = 1; assert(b32[(i1*i2)-i1] == bytes1(baRR)); } } ```

lucasste (Tue, 06 Jul 2021 17:56:40 GMT):
The last line of this example should not pass the semantic analysis for you cannot convert bytes32 to bytes1

lucasste (Tue, 06 Jul 2021 17:56:40 GMT):
This example should not pass the semantic analysis for you cannot convert bytes32 to bytes1 and bytes to byte32.

lucasste (Tue, 06 Jul 2021 17:57:22 GMT):
The analysis finished, but the solang crashes on codegen `thread 'main' panicked at 'internal error: entered unreachable code', src/codegen/constant_folding.rs:1065:14`

lucasste (Tue, 06 Jul 2021 17:57:22 GMT):
The analysis finishes, but the solang crashes on codegen `thread 'main' panicked at 'internal error: entered unreachable code', src/codegen/constant_folding.rs:1065:14`

lucasste (Tue, 06 Jul 2021 20:41:15 GMT):
When does an `ExternalFunctionCallRaw` happens?

lucasste (Tue, 06 Jul 2021 22:30:23 GMT):
Hey @seanyoung , I think I've covered most cases in my tests. I've updated the PR. Tomorrow I'll check them to make sure that I've covered everything. I'll also update Confluence with examples.

seanyoung (Tue, 06 Jul 2021 22:31:19 GMT):
Great! I'll review tomorrow morning.

lucasste (Tue, 06 Jul 2021 22:31:46 GMT):
For this week's evaluation, the PR is basically complete. Once I double check my tests tomorrow, I will mark is as ready for review.

lucasste (Tue, 06 Jul 2021 22:31:46 GMT):
For this week's evaluation, the PR is basically complete. Once I double check my tests tomorrow, I will mark it as ready for review.

seanyoung (Tue, 06 Jul 2021 22:31:50 GMT):
`ExternFunctionCallRaw` happens when you do `

.call()`

seanyoung (Wed, 07 Jul 2021 00:16:07 GMT):
That contract is valid solidity, the codegen for it is broken. I've fixed it, just making a PR

seanyoung (Wed, 07 Jul 2021 00:41:02 GMT):
Thanks for the bugreport: I've written a fix in this PR https://github.com/hyperledger-labs/solang/pull/430

lucasste (Wed, 07 Jul 2021 15:06:41 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=LDrXMEqEH9z39QJ7y) Now there is a function `lucas` in the tests :woo:

lucasste (Wed, 07 Jul 2021 15:16:28 GMT):
``````

lucasste (Wed, 07 Jul 2021 15:16:28 GMT):
```error[E0061]: this function takes 3 arguments but 4 arguments were supplied --> tests/solana.rs:922:26 | 922 | let executable = >::from_elf( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 arguments 923 | &self.account_data[&program.program].data, | ----------------------------------------- 924 | None, | ---- 925 | Config::default(), | ----------------- 926 | syscall_registry, | ---------------- supplied 4 arguments |```

lucasste (Wed, 07 Jul 2021 15:16:59 GMT):
I'm seeing this error when I run tests

lucasste (Wed, 07 Jul 2021 15:20:24 GMT):
@seanyoung It looks like you introduced the fourth argument on you PR yesterday.

lucasste (Wed, 07 Jul 2021 15:20:24 GMT):
@seanyoung It looks like you introduced the fourth argument on your PR yesterday.

lucasste (Wed, 07 Jul 2021 15:24:55 GMT):
``` let mut executable = >::from_elf( &self.account_data[&program.program].data, None, Config::default(), ) .expect("should work"); executable.set_syscall_registry(syscall_registry); ```

lucasste (Wed, 07 Jul 2021 15:25:05 GMT):
Everything works when I change the code to this

seanyoung (Wed, 07 Jul 2021 16:58:06 GMT):
The solana_rbpf crate is out of date. I thought I updated the Cargo.toml to say 0.2.11 or later

seanyoung (Wed, 07 Jul 2021 16:58:17 GMT):
If you remove Cargo.lock and then try again it should work

seanyoung (Wed, 07 Jul 2021 16:59:26 GMT):
I don't understand why I have to approve the CI every time you do a push. I thought the approve was only once per user

lucasste (Wed, 07 Jul 2021 17:10:28 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=uLaZHn33YDqif7Axp) Apparently the CI tests on Mac and Windows failed due to the same error as the one I sent you here. I thought that Cargo.lock was auto generated.

lucasste (Wed, 07 Jul 2021 17:17:17 GMT):
Yesterday at least (today they worked)

lucasste (Wed, 07 Jul 2021 19:10:46 GMT):
``` ---- substrate_tests::contracts::external_datatypes stdout ---- test.sol:4:27-33: warning: ‘public’: visibility for constructors is ignored test.sol:19:32-38: warning: ‘public’: visibility for constructors is ignored test.sol:23:13-86: warning: function can be declared ‘view’ seal_random: 15a28984b002a3a0f226fa05cf4fc42425c53fa25c0b0558561effc6e12d2863 7308a977d26f29ab0788cbd6c021644e8127c029c794bd8846085563274e3903 seal_minimum_balance: f4010000000000000000000000000000 seal_instantiate value:500 input=98e0bd8c6600000000000000000000000000000000000000000000000000000000000000 salt=7308a977d26f29ab0788cbd6c021644e8127c029c794bd8846085563274e3903 thread 'substrate_tests::contracts::external_datatypes' panicked at 'codehash not found', tests/substrate.rs:639:22 ```

lucasste (Wed, 07 Jul 2021 19:11:55 GMT):
I am getting this error during tests, but it is intermittent

lucasste (Wed, 07 Jul 2021 19:12:06 GMT):
Sometimes I get it and sometime I don't

lucasste (Wed, 07 Jul 2021 19:12:06 GMT):
Sometimes I get it and sometimes I don't

seanyoung (Wed, 07 Jul 2021 20:03:04 GMT):
Hash iteration can get change between iterations

seanyoung (Wed, 07 Jul 2021 20:03:46 GMT):
if you push your changes then I can see if I can figure out what the issue is

lucasste (Wed, 07 Jul 2021 20:07:01 GMT):
I pushed and requested your review for the PR

lucasste (Wed, 07 Jul 2021 20:08:28 GMT):
Today I'm leaving work early because it is my birthday :grinning: Tomorrow, I'll update the documentation on the project plan to include some examples

seanyoung (Wed, 07 Jul 2021 20:59:16 GMT):
Hey congratulations! :birthday:

seanyoung (Wed, 07 Jul 2021 21:01:31 GMT):
Hope you have a nice evening

lucasste (Thu, 08 Jul 2021 13:24:55 GMT):
For some reason, when I run `cargo clippy`, it doesn't detect changes in the `tests` directory

seanyoung (Thu, 08 Jul 2021 13:48:19 GMT):
You need to run ` cargo clippy --tests --bins`

seanyoung (Thu, 08 Jul 2021 13:48:31 GMT):
(see .github/workflows/test.yaml)

lucasste (Thu, 08 Jul 2021 13:57:44 GMT):
I've just found out that :joy:

lucasste (Fri, 09 Jul 2021 10:53:14 GMT):
``` contract T { int p; constructor(int b) { p = b; } function sum(int a, int b) virtual public returns (int){ return a + b * p; } } contract Test is T(2){ struct fooStruct { int foo; int figther; } mapping(string => int) public mp; function sum(int a, int b) override public pure returns (int) { return a*b; } function test() public { int a = 1; int b = 2; int c = super.sum(a, b); int d = 3; fooStruct memory myStruct = fooStruct({foo: c, figther: d}); string memory t = "Do some tests"; mp[t] = myStruct.figther; } } ```

lucasste (Fri, 09 Jul 2021 10:53:35 GMT):
This example raises this error: `thread 'main' panicked at 'Found StructValue(StructValue { struct_value: Value { name: "", address: 0x556c71404b50, is_const: true, is_null: false, is_undef: false, llvm_value: "{ i8*, i32 } { i8* getelementptr inbounds ([13 x i8], [13 x i8]* @const_string, i32 0, i32 0), i32 13 }", llvm_type: "{ i8*, i32 }" } }) but expected a different variant', /home/lucas/.cargo/registry/src/github.com-1ecc6299db9ec823/inkwell-0.1.0-beta.2/src/values/enums.rs:357:13`

lucasste (Fri, 09 Jul 2021 10:53:35 GMT):
This example raises the error: `thread 'main' panicked at 'Found StructValue(StructValue { struct_value: Value { name: "", address: 0x556c71404b50, is_const: true, is_null: false, is_undef: false, llvm_value: "{ i8*, i32 } { i8* getelementptr inbounds ([13 x i8], [13 x i8]* @const_string, i32 0, i32 0), i32 13 }", llvm_type: "{ i8*, i32 }" } }) but expected a different variant', /home/lucas/.cargo/registry/src/github.com-1ecc6299db9ec823/inkwell-0.1.0-beta.2/src/values/enums.rs:357:13`

lucasste (Fri, 09 Jul 2021 10:53:47 GMT):
Is there something wrong with it?

seanyoung (Fri, 09 Jul 2021 11:42:46 GMT):
Looks like `mapping(string => int)` is somehow broken

seanyoung (Fri, 09 Jul 2021 12:50:01 GMT):
I'll look into it

lucasste (Fri, 09 Jul 2021 13:39:12 GMT):
``` let sdecl = Variable { name: s.name.name.to_string(), loc: s.loc, tags, visibility: visibility.clone(), ty: ty.clone(), constant: is_constant, initializer, read: false, assigned: initializer.is_some(), }; ```

lucasste (Fri, 09 Jul 2021 13:39:26 GMT):
This won't work

lucasste (Fri, 09 Jul 2021 13:39:46 GMT):
``` error[E0382]: borrow of moved value: `initializer` --> src/sema/variables.rs:254:19 | 179 | let initializer = if let Some(initializer) = &s.initializer { | ----------- move occurs because `initializer` has type `std::option::Option`, which does not implement the `Copy` trait ... 252 | initializer, | ----------- value moved here 253 | read: false, 254 | assigned: initializer.is_some(), | ^^^^^^^^^^^ value borrowed here after move ```

lucasste (Fri, 09 Jul 2021 13:40:15 GMT):
What I can do is change `initilizaer` to `initializer: initializer.clone()`

lucasste (Fri, 09 Jul 2021 13:40:15 GMT):
What I can do is change `initilaizer` to `initializer: initializer.clone()`

lucasste (Fri, 09 Jul 2021 13:48:44 GMT):
@seanyoung This tests keeps failling for me

lucasste (Fri, 09 Jul 2021 13:48:44 GMT):
@seanyoung This test keeps failing for me

lucasste (Fri, 09 Jul 2021 14:02:48 GMT):
How do you commit changes without having to signoff them later?

seanyoung (Fri, 09 Jul 2021 14:41:07 GMT):
you could also do `let assigned = initializer.is_some();` before `initializer` is moved

seanyoung (Fri, 09 Jul 2021 14:43:38 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=2tXA6uTsohrovkqdT) cloning the entire initializer for a simple boolean is bit much :)

seanyoung (Fri, 09 Jul 2021 14:44:17 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=6BbZTktNXqanYH3iL) I'm not sure what you mean. Do you mean how to add a signed-off-by: after making the commit?

seanyoung (Fri, 09 Jul 2021 14:55:32 GMT):
I've tried: ``` [sean@xywoleh solang]$ git remote update Fetching sean Fetching origin Fetching kichjang Fetching xf3rno Fetching mul53 Fetching lucas remote: Enumerating objects: 82, done. remote: Counting objects: 100% (75/75), done. remote: Compressing objects: 100% (13/13), done. remote: Total 39 (delta 32), reused 32 (delta 25), pack-reused 0 Unpacking objects: 100% (39/39), 5.46 KiB | 103.00 KiB/s, done. From https://github.com/LucasSte/solang 8edac3e..0e14dac unused-variable-detection -> lucas/unused-variable-detection [sean@xywoleh solang]$ git checkout lucas/unused-variable-detection Note: switching to 'lucas/unused-variable-detection'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -c Or undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at 0e14dac Address reviewer issues and add a new test case [sean@xywoleh solang]$ while true; do cargo test external_datatypes; done Compiling solang v0.1.7 (/home/sean/git/solang) Finished test [unoptimized + debuginfo] target(s) in 41.02s Running unittests (target/debug/deps/solang-e30550c5a0092868) running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s Running unittests (target/debug/deps/solang-a36f72a8447d77f8) running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Running tests/builtins.rs (target/debug/deps/builtins-3b65d22b4a9780b8) running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s Running tests/codegen.rs (target/debug/deps/codegen-b742bc213b736d39) running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s Running tests/ewasm.rs (target/debug/deps/ewasm-7b830f7d23a4f652) running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 46 filtered out; finished in 0.00s Running tests/solana.rs (target/debug/deps/solana-8a17ebd4e57cac1b) running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 55 filtered out; finished in 0.00s Running tests/substrate.rs (target/debug/deps/substrate-6250b651ad619f67) running 1 test test substrate_tests::contracts::external_datatypes ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 242 filtered out; finished in 0.17s Running tests/unused_variable_detection.rs (target/debug/deps/unused_variable_detection-ead42e6caf47e3a0) ```

seanyoung (Fri, 09 Jul 2021 14:55:54 GMT):
The test never seems to fail for me. How are you running it?

lucasste (Fri, 09 Jul 2021 14:59:53 GMT):
`cargo test`

seanyoung (Fri, 09 Jul 2021 15:06:51 GMT):
Does this test fail with `cargo test -j 1`

lucasste (Fri, 09 Jul 2021 15:30:49 GMT):
Sometimes

lucasste (Fri, 09 Jul 2021 15:30:57 GMT):
The error is intermittent

seanyoung (Fri, 09 Jul 2021 15:31:30 GMT):
I wanted to see if the issue is due to threading.

lucasste (Fri, 09 Jul 2021 15:33:03 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=j7AjdxtsJdixv8SEd) Or I can move initilializer above assigned when creating the struct

lucasste (Fri, 09 Jul 2021 15:33:03 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=j7AjdxtsJdixv8SEd) Or I can place initilializer above assigned when creating the struct

lucasste (Fri, 09 Jul 2021 15:33:03 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=j7AjdxtsJdixv8SEd) Or I can place assigned above initializer when creating the struct

lucasste (Fri, 09 Jul 2021 15:35:06 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=Lfiz4auXEJQFwE6Gr) Whenever I commit something, github tells me to sign off my commits and o a push force. Is there a way to sign off when running `git commit`?

lucasste (Fri, 09 Jul 2021 15:35:06 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=Lfiz4auXEJQFwE6Gr) Whenever I commit something, github tells me to sign off my commits and do a push force. Is there a way to sign off when running `git commit`?

seanyoung (Fri, 09 Jul 2021 16:04:04 GMT):
Did you build your own llvm and what tree did you use for that?

lucasste (Fri, 09 Jul 2021 16:42:23 GMT):
I built my own llvm, following the instructions on solang documentation

seanyoung (Fri, 09 Jul 2021 16:42:34 GMT):
ok

seanyoung (Fri, 09 Jul 2021 16:42:47 GMT):
It's hard to debug without a reproduction.

seanyoung (Fri, 09 Jul 2021 16:42:56 GMT):
Are you using the latest rust compiler?

lucasste (Fri, 09 Jul 2021 16:43:19 GMT):
1.53.0

lucasste (Fri, 09 Jul 2021 16:43:31 GMT):
Did you test my PR?

seanyoung (Fri, 09 Jul 2021 16:43:56 GMT):
Yes, I've been running `cargo test` in a loop - no failures

lucasste (Fri, 09 Jul 2021 16:44:27 GMT):
When you built llvm, did you use the default branch?

lucasste (Fri, 09 Jul 2021 16:44:48 GMT):
```git clone git://github.com/solana-labs/llvm-project cd llvm-project```

lucasste (Fri, 09 Jul 2021 16:45:01 GMT):
This is what I found in the docs

lucasste (Fri, 09 Jul 2021 16:45:09 GMT):
It doesn't change branches

lucasste (Fri, 09 Jul 2021 16:46:09 GMT):
I got this error when using linux and mac. Maybe there is something wrong with my setup, as I did the same thing on both systems

seanyoung (Fri, 09 Jul 2021 16:46:22 GMT):
Hmm that is odd, I don't think the default branch is the right one. Let me check..

seanyoung (Fri, 09 Jul 2021 16:48:43 GMT):
Well, the default branch was right (it's llvm 12 now, but that only recently changed)

lucasste (Fri, 09 Jul 2021 16:51:28 GMT):
When I comment the function `external_datatypes`, I get no error. This is what I am doing to bypass this for now

lucasste (Fri, 09 Jul 2021 16:51:28 GMT):
When I comment the function `external_datatypes`, I get no error. This is what I've been doing to bypass this for now

seanyoung (Fri, 09 Jul 2021 16:53:57 GMT):
Strange. The test also passes on ci, right?

lucasste (Fri, 09 Jul 2021 16:55:10 GMT):
Yes

lucasste (Fri, 09 Jul 2021 16:56:20 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=StarpzrXyncFuJEae) It looks like you only ran one test here

seanyoung (Fri, 09 Jul 2021 16:58:30 GMT):
Yes, I was just running the test that fails for you. Does it fail if you run it like that?

lucasste (Fri, 09 Jul 2021 16:58:38 GMT):
No

seanyoung (Fri, 09 Jul 2021 16:59:12 GMT):
Interesting.

seanyoung (Fri, 09 Jul 2021 16:59:31 GMT):
what does `llc --version` say for you?

lucasste (Fri, 09 Jul 2021 17:00:02 GMT):
``` LLVM (http://llvm.org/): LLVM version 12.0.1 Optimized build with assertions. Default target: x86_64-unknown-linux-gnu Host CPU: skylake Registered Targets: aarch64 - AArch64 (little endian) aarch64_32 - AArch64 (little endian ILP32) aarch64_be - AArch64 (big endian) amdgcn - AMD GCN GPUs arm - ARM arm64 - ARM64 (little endian) arm64_32 - ARM64 (little endian ILP32) armeb - ARM (big endian) avr - Atmel AVR Microcontroller bpf - BPF (host endian) bpfeb - BPF (big endian) bpfel - BPF (little endian) hexagon - Hexagon lanai - Lanai mips - MIPS (32-bit big endian) mips64 - MIPS (64-bit big endian) mips64el - MIPS (64-bit little endian) mipsel - MIPS (32-bit little endian) msp430 - MSP430 [experimental] nvptx - NVIDIA PTX 32-bit nvptx64 - NVIDIA PTX 64-bit ppc32 - PowerPC 32 ppc32le - PowerPC 32 LE ppc64 - PowerPC 64 ppc64le - PowerPC 64 LE r600 - AMD GPUs HD2XXX-HD6XXX riscv32 - 32-bit RISC-V riscv64 - 64-bit RISC-V sparc - Sparc sparcel - Sparc LE sparcv9 - Sparc V9 systemz - SystemZ thumb - Thumb thumbeb - Thumb (big endian) wasm32 - WebAssembly 32-bit wasm64 - WebAssembly 64-bit x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 xcore - XCore ```

seanyoung (Fri, 09 Jul 2021 17:04:44 GMT):
Right, so you do have llvm 12

seanyoung (Fri, 09 Jul 2021 17:05:03 GMT):
I have not tested it what that version et. inkwell does not support it yet.

seanyoung (Fri, 09 Jul 2021 17:05:14 GMT):
Looks like it mostly works :)

seanyoung (Fri, 09 Jul 2021 17:05:31 GMT):
I suspect this problem goes away if you build using the llvm 11

seanyoung (Fri, 09 Jul 2021 17:05:38 GMT):
Looks like the instructions need updating

seanyoung (Fri, 09 Jul 2021 18:05:02 GMT):
`git commit -s` ?

lucasste (Fri, 09 Jul 2021 19:12:50 GMT):
What version of llvm do you have?

seanyoung (Fri, 09 Jul 2021 21:48:05 GMT):
@lucasste merged -- thank you very much!

seanyoung (Fri, 09 Jul 2021 22:13:27 GMT):
llvm 11

seanyoung (Sat, 10 Jul 2021 09:54:00 GMT):
@lucasste I've updated the documentation with the correct branch for building llvm https://solang.readthedocs.io/en/latest/installing.html#building-llvm-from-source

seanyoung (Sun, 11 Jul 2021 17:19:17 GMT):
@lucasste I've implemented a fix for the mapping issue you found: https://github.com/hyperledger-labs/solang/pull/433

lucasste (Mon, 12 Jul 2021 19:39:36 GMT):
A question out of curiosity. Why do you need C code in solang?

lucasste (Mon, 12 Jul 2021 20:07:53 GMT):
Do you always need to create a temporary variable when you do a function call?

lucasste (Mon, 12 Jul 2021 20:08:54 GMT):
If so, if I can eliminate the assignment of the temporary variable to the variable if the latter is unused.

lucasste (Mon, 12 Jul 2021 20:08:54 GMT):
If so, if I can eliminate the assignment of the temporary variable to the (non-temporary) variable if the latter is unused.

lucasste (Mon, 12 Jul 2021 21:34:44 GMT):
Tomorrow, I rebuild llvm and try again

lucasste (Mon, 12 Jul 2021 21:34:44 GMT):
Tomorrow, I'll rebuild llvm and try again

lucasste (Mon, 12 Jul 2021 21:38:24 GMT):
When I remove an assignment from the cfg, I check if the left side is a function call, but that check must be recursive as expressions such as `a = b + 2*func(d)` are also valid. In such a case, can I use the `recurse` function?

lucasste (Mon, 12 Jul 2021 21:38:24 GMT):
When I remove an assignment from the cfg, I check if the right side is a function call, but that check must be recursive as expressions such as `a = b + 2*func(d)` are also valid. In such a case, can I use the `recurse` function?

lucasste (Mon, 12 Jul 2021 21:47:07 GMT):
I opened this PR, because I found some cases in which solang was detecting variables as unused, even as they have been used.

lucasste (Mon, 12 Jul 2021 21:47:07 GMT):
I opened this PR because I found some cases in which solang was detecting variables as unused, even as they have been used.

lucasste (Mon, 12 Jul 2021 21:47:08 GMT):
https://github.com/hyperledger-labs/solang/pull/434

lucasste (Mon, 12 Jul 2021 21:47:24 GMT):
Please, take a look

lucasste (Mon, 12 Jul 2021 21:47:55 GMT):
The good news is that this time the CI tests ran automatically

seanyoung (Tue, 13 Jul 2021 09:54:00 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=tJBLnMN9BNamQtauY) So we need some code much like a standard library, which will be compiled into the final contract binary. Originally when I started this work, rust did not support wasm yet (wasm was new to llvm). It might be possible to re-write the C code in rust (with some `unsafe {}`). I haven't had the time to look at this, it would be nice.

seanyoung (Tue, 13 Jul 2021 10:01:18 GMT):
Actually I made a mistake in reviewing. The `Signed-off-by` should contain your real name, please change this in future.

seanyoung (Tue, 13 Jul 2021 10:02:04 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=3WGcXBzivFwcBiGLj) Looks like you get automatic CI once you have your first PR merged. Thanks for the fix -- it's been merged

seanyoung (Tue, 13 Jul 2021 10:02:44 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=A9kECSt97zQBi38Ta) Absolutely, that's what it is there for.

seanyoung (Tue, 13 Jul 2021 10:05:09 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=gJsmQdQdRdvTkHarw) The return values for a call need to be assigned to somewhere, so they go to temporary variables. Note that a function can return multiple values in Solidity, but only one in llvm IR.

lucasste (Tue, 13 Jul 2021 21:21:30 GMT):
I am doing some planning on how to eliminate assignments when the assigned variable is unused. I found that assignments can be done inside an expression: `a = b + (c=1)`

lucasste (Tue, 13 Jul 2021 21:22:03 GMT):
This case seem a bit complicated because I must remove the assignment and insert a Literal

lucasste (Tue, 13 Jul 2021 21:22:03 GMT):
This case seems a bit complicated because I must remove the assignment and insert a Literal

seanyoung (Wed, 14 Jul 2021 14:09:12 GMT):
This is an unusual case. It might be more interesting to work in the general case first, and then later think about the assignment-in-expression problem.

seanyoung (Wed, 14 Jul 2021 14:09:41 GMT):
I think solidity should not allow such ugly constructs, but I can't decide that.

lucasste (Wed, 14 Jul 2021 17:47:09 GMT):
FYI, installing llvm 11 solved the issue

lucasste (Wed, 14 Jul 2021 17:47:22 GMT):
I left a comment at your PR

lucasste (Wed, 14 Jul 2021 19:48:24 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=hCPrNK29MjdQx6TDG) I implemented the basic case and codegen tests fail on file `slice1.sol`, because most of the slices are never used and I have removed them from the code.

lucasste (Wed, 14 Jul 2021 19:49:03 GMT):
To fix those tests, I am going to use those slices, instead of removing the check at all

lucasste (Wed, 14 Jul 2021 19:51:34 GMT):
At least when I can do that. ``` function test1() public pure returns (bytes) { bytes x = "foo1"; // x is not being used, so it can be a slice // CHECK: alloc slice uint32 4 "foo1" } ```

lucasste (Wed, 14 Jul 2021 19:51:54 GMT):
To make this test1 work, I am going to remove the check

lucasste (Wed, 14 Jul 2021 19:52:20 GMT):
Because `x` is not event in the code

lucasste (Wed, 14 Jul 2021 19:52:20 GMT):
Because `x` is not in the code

lucasste (Wed, 14 Jul 2021 20:39:57 GMT):
While I was fixing the codegen test, I found out that I was not detecting used variables inside `delete` statements. So, I opened this PR

lucasste (Wed, 14 Jul 2021 20:39:58 GMT):
https://github.com/hyperledger-labs/solang/pull/436

lucasste (Wed, 14 Jul 2021 20:40:09 GMT):
Please, take a look

seanyoung (Wed, 14 Jul 2021 22:12:29 GMT):
@lucasste perfect, merged

seanyoung (Wed, 14 Jul 2021 22:12:38 GMT):
Thanks!

seanyoung (Wed, 14 Jul 2021 22:12:51 GMT):
Great! Glad to hear it.

seanyoung (Thu, 15 Jul 2021 08:13:49 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=HsQgm39fQfQPyHrme) Those tests will need updating. I'm happy to help with that

lucasste (Thu, 15 Jul 2021 17:48:03 GMT):
Found another edge case the unused variable detection

lucasste (Thu, 15 Jul 2021 17:48:04 GMT):
https://github.com/hyperledger-labs/solang/pull/437

seanyoung (Thu, 15 Jul 2021 20:36:11 GMT):
@lucasste you okay with https://github.com/hyperledger-labs/solang/pull/435 ?

lucasste (Thu, 15 Jul 2021 21:26:56 GMT):
LGTM

lucasste (Thu, 15 Jul 2021 21:26:58 GMT):
I approved it

seanyoung (Thu, 15 Jul 2021 21:40:26 GMT):
Thanks!

lucasste (Thu, 15 Jul 2021 22:12:30 GMT):
``` struct S { uint64 f1; bool f2; } contract foo { S[] store; function push1(S x) public { store.push(x); } function push2(S x) public { S storage f = store.push(); f.f1 = x.f1; f.f2 = x.f2; } function push_empty() public { store.push(); } function pop() public returns (S) { return store.pop(); } function len() public returns (uint) { return store.length; } function subscript(uint32 i) public returns (S) { return store[i]; } function copy() public returns (S[] memory) { return store; } function set(S[] memory n) public { store = n; } function rm() public { delete store; } } ```

lucasste (Thu, 15 Jul 2021 22:12:40 GMT):
This example crashes solang

lucasste (Thu, 15 Jul 2021 22:12:57 GMT):
`thread 'main' panicked at 'Found StructValue(StructValue { struct_value: Value { name: "", address: 0x55d27860bd00, is_const: false, is_null: false, is_undef: false, llvm_value: " %7 = load { i64, i1 }, { i64, i1 }* %entry3, align 8", llvm_type: "{ i64, i1 }" } }) but expected a different variant', /home/lucas/.cargo/registry/src/github.com-1ecc6299db9ec823/inkwell-0.1.0-beta.2/src/values/enums.rs:357:13`

lucasste (Thu, 15 Jul 2021 22:13:29 GMT):
I thought it was related to what I've been working on, but it crashes on the main branch too

lucasste (Thu, 15 Jul 2021 22:19:03 GMT):
When I declare a storage variable in a function, it is actually a reference to a contract variable. Does it make sense to raise warnings for unused (but assigned) storage (references) variables?

lucasste (Thu, 15 Jul 2021 22:19:49 GMT):
I detected another edge case in my logic and I had to add the storage location to the symbol table. I can refactor the warnings as well for this case.

lucasste (Thu, 15 Jul 2021 22:37:30 GMT):
``` fn array_bounds_dynamic_array() { let mut runtime = build_solidity( r#" contract foo { function test() public { int32[] memory a = new int32[](5); a[5] = 102; } }"#, ); runtime.function("test", Vec::new()); } ```

lucasste (Thu, 15 Jul 2021 22:37:58 GMT):
What are you testing there? This test is now failing, because I removed `a` from the code.

seanyoung (Thu, 15 Jul 2021 22:59:36 GMT):
This is testing the index out of bound test.

lucasste (Fri, 16 Jul 2021 00:58:25 GMT):
I couldn't find where you create the intermediate representation of contract variables. I remember you told me to look at `layout contract`, but I couldn't find it

richarde 7 (Fri, 16 Jul 2021 07:24:00 GMT):
Has joined the channel.

richarde 7 (Fri, 16 Jul 2021 07:24:00 GMT):
Hello

richarde 7 (Fri, 16 Jul 2021 07:24:42 GMT):
I need a support

richarde 7 (Fri, 16 Jul 2021 07:24:42 GMT):
I need a supporter

richarde 7 (Fri, 16 Jul 2021 08:42:39 GMT):
I can not compile the examples on https://docs.soliditylang.org/en/v0.5.3/solidity-by-example.html

richarde 7 (Fri, 16 Jul 2021 08:42:39 GMT):
I can not compile the examples on https://docs.soliditylang.org/en/v0.7.0/solidity-by-example.html

richarde 7 (Fri, 16 Jul 2021 08:49:40 GMT):
``` info: Solang version v0.1.7-151-gf45faf8 /sources/test.sol:2:8-31: debug: pragma ‘solidity’ is ignored /sources/test.sol:5:1-17: debug: found contract ‘Ballot’ /sources/test.sol:106:13-38: error: array subscript must be an unsigned integer, not ‘uint256 storage’ /sources/test.sol:76:5-41: warning: function can be declared ‘pure’ /sources/test.sol: error: no valid contracts found ```

seanyoung (Fri, 16 Jul 2021 09:02:16 GMT):
@richarde 7 interesting, that is a bug. Let me have a look.

richarde 7 (Fri, 16 Jul 2021 09:05:02 GMT):
@seanyoung in case you need info, that is 1st example

seanyoung (Fri, 16 Jul 2021 11:09:07 GMT):
@richarde 7 I've implemented a fix: https://github.com/hyperledger-labs/solang/pull/438

seanyoung (Fri, 16 Jul 2021 11:09:22 GMT):
hmm rocketchat doesn't seem to deal well with spaces in usernames..

seanyoung (Sun, 18 Jul 2021 10:18:06 GMT):
@lucasste I've written a fix for the issue you found https://github.com/hyperledger-labs/solang/pull/440

richarde 7 (Mon, 19 Jul 2021 01:46:13 GMT):
Thanks @seanyoung. It's working now.

richarde 7 (Mon, 19 Jul 2021 02:20:40 GMT):
Hi @seanyoung I'm going to build a large solidity project. You can check at: https://github.com/richard-creatorchain/solang-contribute So, there were many errors while compile: ``` info: Solang version v0.1.7-157-ge64a7a2 /sources/UniswapV2Router01.sol:12:30-38: error: unrecognised token `override', expected ";", "=" /sources/UniswapV2Router01.sol: error: no valid contracts found ```

richarde 7 (Mon, 19 Jul 2021 02:20:40 GMT):
Hi @seanyoung I'm going to build a large solidity project. You can check at: https://github.com/richard-creatorchain/solang-contribute So, there were many errors while compile: ``` info: Solang version v0.1.7-157-ge64a7a2 /sources/UniswapV2Router01.sol:12:30-38: error: unrecognised token `override', expected ";", "=" /sources/UniswapV2Router01.sol: error: no valid contracts found ``` This is the content of file what I'm compiling: https://github.com/richard-creatorchain/solang-contribute/blob/master/contracts/UniswapV2Router01.sol

richarde 7 (Mon, 19 Jul 2021 02:20:40 GMT):
Hi @seanyoung I'm going to build a larger solidity project. You can check at: https://github.com/richard-creatorchain/solang-contribute So, there were many errors while compile: ``` info: Solang version v0.1.7-157-ge64a7a2 /sources/UniswapV2Router01.sol:12:30-38: error: unrecognised token `override', expected ";", "=" /sources/UniswapV2Router01.sol: error: no valid contracts found ``` This is the content of file what I'm compiling: https://github.com/richard-creatorchain/solang-contribute/blob/master/contracts/UniswapV2Router01.sol

richarde 7 (Mon, 19 Jul 2021 02:34:33 GMT):
@seanyoung I'm not sure about Truffle convert to Solang compiler, is it right?

richarde 7 (Mon, 19 Jul 2021 02:37:28 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=9tKYnK7nQZLWuCpRC) I'm not sure about change this username to other :joy:

richarde 7 (Mon, 19 Jul 2021 02:37:28 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=9tKYnK7nQZLWuCpRC) I'm not sure about change this username to other :joy: the username with a dot at end, too?

seanyoung (Mon, 19 Jul 2021 09:10:30 GMT):
@richarde 7 so I've started on fixing the compilation issue https://github.com/hyperledger-labs/solang/pull/441 for https://github.com/richard-creatorchain/solang-contribute

seanyoung (Mon, 19 Jul 2021 09:10:54 GMT):
I think we can do better than that and properly support `immutable`, so I'm re-working

seanyoung (Mon, 19 Jul 2021 14:10:22 GMT):
Ok, I've now added proper support for `immutable`: https://github.com/hyperledger-labs/solang/pull/441

seanyoung (Mon, 19 Jul 2021 14:11:08 GMT):
Now https://github.com/richard-creatorchain/solang-contribute should compile fine, apart from a downcast error (passing `uint256` as value is larger than the value type).

seanyoung (Mon, 19 Jul 2021 14:11:40 GMT):
As for truffle support, no that does not exist yet, but it would be very interesting. Which chain are you interested in using?

lucasste (Mon, 19 Jul 2021 17:14:39 GMT):
@seanyoung Have you had the change to take a look at this?

lucasste (Mon, 19 Jul 2021 17:15:24 GMT):
Oh

lucasste (Mon, 19 Jul 2021 17:15:32 GMT):
I've just seen your PR

lucasste (Mon, 19 Jul 2021 17:15:39 GMT):
Sorry for not reading the chat first

richarde 7 (Tue, 20 Jul 2021 04:59:56 GMT):
Thanks @seanyoung it's working now

richarde 7 (Tue, 20 Jul 2021 05:01:01 GMT):
Using new docker image. There is an error while build: ``` info: Solang version v0.1.7-159-g0d4fcdf /sources/UniswapV2Migrator.sol:1:8-23: debug: pragma ‘solidity’ is ignored /sources/uniswap/lib/contracts/libraries/TransferHelper.sol:1:8-24: debug: pragma ‘solidity’ is ignored /sources/uniswap/lib/contracts/libraries/TransferHelper.sol:4:1-24: debug: found library ‘TransferHelper’ /sources/uniswap/lib/contracts/libraries/TransferHelper.sol:24:41-46: error: conversion truncates uint256 to uint128, as value is type uint128 on Substrate /sources/uniswap/lib/contracts/libraries/TransferHelper.sol:5:5-73: warning: function can be declared ‘pure’ /sources/uniswap/lib/contracts/libraries/TransferHelper.sol:11:5-74: warning: function can be declared ‘pure’ /sources/uniswap/lib/contracts/libraries/TransferHelper.sol:17:5-92: warning: function can be declared ‘pure’ /sources/uniswap/lib/contracts/libraries/TransferHelper.sol:23:5-62: warning: function can be declared ‘pure’ /sources/interfaces/IUniswapV2Migrator.sol:1:8-24: debug: pragma ‘solidity’ is ignored /sources/interfaces/V1/IUniswapV1Factory.sol:1:8-24: debug: pragma ‘solidity’ is ignored /sources/interfaces/V1/IUniswapV1Exchange.sol:1:8-24: debug: pragma ‘solidity’ is ignored /sources/interfaces/IUniswapV2Router01.sol:1:8-24: debug: pragma ‘solidity’ is ignored /sources/interfaces/IERC20.sol:1:8-24: debug: pragma ‘solidity’ is ignored /sources/interfaces/IERC20.sol:4:11-19: warning: event 'Approval' has never been emitted /sources/interfaces/IERC20.sol:5:11-19: warning: event 'Transfer' has never been emitted /sources/UniswapV2Migrator.sol: error: no valid contracts found ```

richarde 7 (Tue, 20 Jul 2021 05:03:57 GMT):
Do you think it is a bug?

seanyoung (Tue, 20 Jul 2021 07:31:52 GMT):
There is one error: conversion truncates uint256 to uint128, as value is type uint128 on Substrate So on Substrate, value is a 128 bit type. However here on a call() method a 256 bit type is passed. Now this is permitted on Ethereum, but makes no sense on Substrate. So the code should be updated to a smaller type or an explicit cast to 128 bits. Either that or Solang should accept the larger type. But if the value given is larger than 128 bits, what do we do then?

seanyoung (Tue, 20 Jul 2021 07:32:19 GMT):
You can remove the error by replacing the line with: ``` (bool success,) = to.call{value:uint128(value)}(new bytes(0)); ```

seanyoung (Tue, 20 Jul 2021 07:33:03 GMT):
There are several warnings: function can be declared ‘pure’ These are bugs in Solang. I have fixed them: https://github.com/hyperledger-labs/solang/pull/442

richarde 7 (Tue, 20 Jul 2021 07:38:24 GMT):
Thanks @seanyoung

seanyoung (Tue, 20 Jul 2021 07:43:12 GMT):
I have some more fixes

richarde 7 (Tue, 20 Jul 2021 07:48:02 GMT):
What do you think about this @seanyoung ? ``` /sources/UniswapV2Migrator.sol:28:60-88: error: cannot call method on immutable outside of constructor ```

richarde 7 (Tue, 20 Jul 2021 07:48:47 GMT):
This is line 28: ``` IUniswapV1Exchange exchangeV1 = IUniswapV1Exchange(factoryV1.getExchange(token)); ```

richarde 7 (Tue, 20 Jul 2021 07:49:37 GMT):
It is fine for me, not sure about this error

seanyoung (Tue, 20 Jul 2021 08:03:50 GMT):
I discovered that too

seanyoung (Tue, 20 Jul 2021 08:46:39 GMT):
ok I merged https://github.com/hyperledger-labs/solang/pull/442

seanyoung (Tue, 20 Jul 2021 08:47:06 GMT):
now there is a new problem: ``` /home/sean/git/solang-contribute/contracts/libraries/UniswapV2Library.sol:3:8-68: error: file not found ‘../uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol’ ```

seanyoung (Tue, 20 Jul 2021 09:45:34 GMT):
Ok there are some further issues.

seanyoung (Tue, 20 Jul 2021 09:45:43 GMT):
Let me get back to you

seanyoung (Tue, 20 Jul 2021 09:46:01 GMT):
The files are now parsed correctly, with the value casts.

richarde 7 (Tue, 20 Jul 2021 09:52:56 GMT):
@seanyoung nice work. It's working for me now

richarde 7 (Tue, 20 Jul 2021 09:54:26 GMT):
Thanks @seanyoung hope to keep going :yum:

richarde 7 (Tue, 20 Jul 2021 10:06:11 GMT):
Hi @seanyoung there is solang error, check latest commit: ``` info: Solang version v0.1.7-164-gf29d3f1 thread 'main' panicked at 'expr should not be in cfg: InternalFunctionCall { loc: Loc(0, 7327, 7381), returns: [Address(false)], function: InternalFunction { loc: Loc(0, 7327, 7381), ty: InternalFunction { mutability: Some(Pure(Loc(3, 791, 795))), params: [Address(false), Address(false), Address(false)], returns: [Address(false)] }, function_no: 43, signature: None }, args: [StorageLoad(Loc(0, 7352, 7359), Address(false), StorageVariable(Loc(0, 7352, 7359), StorageRef(true, Address(false)), 0, 0)), Variable(Loc(0, 7361, 7367), Address(false), 169), Load(Loc(0, 7369, 7380), Address(false), Subscript(Loc(0, 7369, 7380), Array(Address(false), [None]), Variable(Loc(0, 7369, 7373), Array(Address(false), [None]), 165), Add(Loc(0, 7376, 7377), Uint(256), Variable(Loc(0, 7374, 7375), Uint(256), 167), NumberLiteral(Loc(0, 7378, 7379), Uint(256), 2))))] }', src/codegen/constant_folding.rs:1065:14 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ```

seanyoung (Tue, 20 Jul 2021 10:06:34 GMT):
Yes, I'm looking at that

richarde 7 (Tue, 20 Jul 2021 10:22:43 GMT):
There seems to be an `import` problem?

seanyoung (Tue, 20 Jul 2021 10:42:46 GMT):
I've created https://github.com/richard-creatorchain/solang-contribute/pull/1

seanyoung (Tue, 20 Jul 2021 10:43:01 GMT):
also these fixes are needed https://github.com/hyperledger-labs/solang/pull/444

seanyoung (Tue, 20 Jul 2021 10:43:20 GMT):
I'll merge the solang pr once the tests pass

seanyoung (Tue, 20 Jul 2021 10:43:40 GMT):
with all of that, now I have a bunch of compiled contracts

richarde 7 (Wed, 21 Jul 2021 02:26:02 GMT):
Nice @seanyoung So, all contracts has been compiled success.

lucasste (Fri, 23 Jul 2021 14:34:33 GMT):
I've opened the PR for unused variable elimination. Please, @seanyoung take a look.

lucasste (Fri, 23 Jul 2021 14:34:34 GMT):
https://github.com/hyperledger-labs/solang/pull/448

lucasste (Fri, 23 Jul 2021 17:25:14 GMT):
CI tests are failing here: ``` error[E0432]: unresolved import `solana_rbpf::vm::DefaultInstructionMeter` --> tests/solana.rs:17:18 | 17 | vm::{Config, DefaultInstructionMeter, EbpfVm, Executable, SyscallObject, SyscallRegistry}, | ^^^^^^^^^^^^^^^^^^^^^^^ | | | no `DefaultInstructionMeter` in `vm` | help: a similar name exists in the module: `TestInstructionMeter` error: aborting due to previous error ```

lucasste (Fri, 23 Jul 2021 17:25:27 GMT):
But it don't get this error in my computer

lucasste (Fri, 23 Jul 2021 17:25:27 GMT):
But I don't get this error in my computer

lucasste (Fri, 23 Jul 2021 17:25:45 GMT):
Did something change in solang dependecies?

seanyoung (Fri, 23 Jul 2021 17:38:36 GMT):
I was just reading your PR

seanyoung (Fri, 23 Jul 2021 17:39:42 GMT):
Hmm something might have changed in the solana_rbpf crate, that's not the first time this has happened. The CI will pick up the latest version of the crate, but locally you have the Cargo.lock file

seanyoung (Fri, 23 Jul 2021 17:40:56 GMT):
Let me have a look

seanyoung (Fri, 23 Jul 2021 18:10:50 GMT):
https://github.com/hyperledger-labs/solang/pull/449

lucasste (Mon, 26 Jul 2021 18:45:48 GMT):
I tried to install solang on windows to fix the windows test that keeps failing, but it is overcomplicated

lucasste (Mon, 26 Jul 2021 18:46:05 GMT):
And I gave up

lucasste (Mon, 26 Jul 2021 18:55:52 GMT):
I really don't understand how things are so complicated in Windows

lucasste (Mon, 26 Jul 2021 18:55:52 GMT):
I really don't understand why things are so complicated in Windows

lucasste (Mon, 26 Jul 2021 20:03:20 GMT):
I'll try again. I couldn't debug on linux

seanyoung (Mon, 26 Jul 2021 21:57:30 GMT):
I totally agree, things are far too complicated in Windows.

seanyoung (Mon, 26 Jul 2021 21:57:50 GMT):
I'm trying to figure out why we're using so much stack space.

seanyoung (Mon, 26 Jul 2021 21:59:37 GMT):
It's not really obvious how to start on this..

seanyoung (Tue, 27 Jul 2021 08:55:25 GMT):
So if I set the stack size to 0.5MB with `ulimit -s 512` then the codegen tests fail, but none of the other tests fail.

seanyoung (Tue, 27 Jul 2021 09:31:32 GMT):
Made some progress. Steps: 1. Compile solang into asm: `cargo rustc --lib -- --emit asm` 2. Assembly is in `target/debug/deps/solang-*s` 3. Entry of every function starts with something like: ``` movl $114152, %eax callq __rust_probestack ``` This is solang::sema::expression::expression which uses 114k stack size! This is the worst offender.

seanyoung (Tue, 27 Jul 2021 09:57:34 GMT):
When compiling in release mode, the stack size goes down to 2129 for solang::sema::expression::expression!

seanyoung (Tue, 27 Jul 2021 09:59:34 GMT):
So I think what happening is: solang::sema::expression::expression() is a huge functions, a giant match statement with many arms. Each arm allocates stuff on the stack. In debug mode, each of those allocations adds to the stack frame making a giant stack frame. In release mode, llvm does life-time analysis and realises that much of the stack frame can be re-used in each arm of the match statement and the stack frame is a prefectly reasonable size.

seanyoung (Tue, 27 Jul 2021 10:00:27 GMT):
So the solution is that solang::sema::expression::expression() and other functions are split into many smaller functions. I was going to do that anyway.

seanyoung (Tue, 27 Jul 2021 10:01:06 GMT):
In the mean time, to make the codegen tests work, it is probably best if you add `--release` to the command line.

seanyoung (Tue, 27 Jul 2021 10:01:19 GMT):
That should be enough to unlock you @lucasste

seanyoung (Tue, 27 Jul 2021 10:01:19 GMT):
That should be enough to unblock you @lucasste

lucasste (Tue, 27 Jul 2021 11:30:44 GMT):
Thanks

seanyoung (Tue, 27 Jul 2021 15:19:31 GMT):

Thanks Lucas, Solang is now more than 100k lines!

seanyoung (Tue, 27 Jul 2021 15:19:42 GMT):
(merged)

seanyoung (Wed, 28 Jul 2021 21:34:30 GMT):
So I've split sema::expression into smaller functions. It was huge! https://github.com/hyperledger-labs/solang Now we don't need to run the windows tests in release mode

lucasste (Wed, 28 Jul 2021 21:44:41 GMT):
Where does solang convert the CFG to LLVM IR?

seanyoung (Wed, 28 Jul 2021 21:53:35 GMT):
Everything in `src/emit/` is about generating llvm ir

seanyoung (Wed, 28 Jul 2021 21:53:41 GMT):
(from the cfg)

seanyoung (Wed, 28 Jul 2021 21:55:15 GMT):
See https://github.com/hyperledger-labs/solang/blob/main/src/emit/mod.rs#L5199

seanyoung (Wed, 28 Jul 2021 21:55:22 GMT):
this file is also way too large

lucasste (Wed, 28 Jul 2021 22:06:13 GMT):
I am considering two alternatives for undefined variable detection: 1. Instead of initializing a variable with a default value, do not initialize it at all. The problem here is that it might have side effects on LLVM side. 2. Initialize the variable with a default value as Solang already does and add a variable to signal it as an undefined. During the reaching definition check, if a "default" initialization reaches a read, the variable might be undefined.

seanyoung (Thu, 29 Jul 2021 08:21:14 GMT):
I think if 2 is implemented correctly, then 1 might be possible.

seanyoung (Thu, 29 Jul 2021 08:22:33 GMT):
The strategy of adding a default initialization (meaning undefined) during reaching definitions is the best way to go.

seanyoung (Thu, 29 Jul 2021 08:30:47 GMT):
If when a variable is read, the only definition is undefined, then you error "variable is read before it is defined" and if one of the reaching definitions is undefined, then the error should be "variable may be read before it is defined" (or something like that)

seanyoung (Thu, 29 Jul 2021 17:28:07 GMT):
I've just merged a few changes. First of all, rust 1.53.0 is required now. The or-patterns in match statements are pretty useful. Also now contract layouting happens in codegen now. I haven't added the unused-contract-storage removal part yet.

lucasste (Thu, 29 Jul 2021 20:02:36 GMT):
reaching_definitions.rs has this type `pub type VarDefs = HashMap>;` What does the boolean mean?

lucasste (Thu, 29 Jul 2021 20:23:31 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=kFRqXjxTLaizRoqWy) ``` pub enum ErrorType { None, ParserError, SyntaxError, DeclarationError, TypeError, Warning, } ``` It looks like we need a new type of error

seanyoung (Fri, 30 Jul 2021 10:21:29 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=tq2u4xmJm9FysFGJC) Modified (useful for e.g. arrays)

seanyoung (Fri, 30 Jul 2021 10:24:46 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=G7orZZ7qygZ34g9gS) This ErrorType is only used for the json output format when you run `solang --standard-json`. The format is documented here: https://docs.soliditylang.org/en/v0.8.6/using-the-compiler.html#error-types

lucasste (Fri, 30 Jul 2021 18:56:31 GMT):
So when the boolean is true, the Def is invalid?

lucasste (Fri, 30 Jul 2021 18:56:47 GMT):
I didn't quite understand the usage of this boolean

lucasste (Fri, 30 Jul 2021 19:56:36 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=HHCEJC7PMRKbufNqe) Which `ErrorType` should we use for undefined variables? (if the only definition that reaches a read is an undefined one)

lucasste (Fri, 30 Jul 2021 20:52:57 GMT):
Can I assume that a default initializer always has `Loc(0, 0, 0)`?

seanyoung (Fri, 30 Jul 2021 21:42:00 GMT):
The modified boolean means that the definition is modified in some way, as in, there is a definition `2` but then it got modified and now the value is no longer know (but it is still reaching)

lucasste (Fri, 30 Jul 2021 21:55:28 GMT):
Can you give me an example?

lucasste (Fri, 30 Jul 2021 21:55:38 GMT):
(Code example)

lucasste (Fri, 30 Jul 2021 21:56:30 GMT):
``` pub fn find_undefined_variables(cfg: &ControlFlowGraph, ns: &mut Namespace, func_no: usize) { //let mut diagnostics : HashMap = HashMap::new(); for block in &cfg.blocks { std::println!("Block name {}", block.name); let mut var_defs : VarDefs = block.defs.clone(); for (instr_no, instruction) in block.instr.iter().enumerate() { apply_transfers(&block.transfers[instr_no], &mut var_defs); check_variables_in_expression(func_no, instruction, &var_defs, ns, cfg); } } } ```

lucasste (Fri, 30 Jul 2021 21:58:06 GMT):
Basically, I am calculating the definitions for each instruction, but I wonder if I can integrate this to the main reaching definitions code and save the calculated defs for each instruction in a vector

lucasste (Fri, 30 Jul 2021 21:58:06 GMT):
Basically, I am calculating the definitions for each instruction, but I wonder if I can integrate this with the main reaching definitions code and save the calculated defs for each instruction in a vector

seanyoung (Fri, 30 Jul 2021 22:01:04 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=nLy8iXbACGXGfgPZw) At the moment there is a convention that `Loc(0, 0, 0)` means no location, but that's not really correct as that is actually a valid location. This should really change into `Option` and `None` for no location (which means implicit). So yes, you are right - for now.

seanyoung (Fri, 30 Jul 2021 22:04:52 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=mYwEQTQCydh9iupbZ) Yes, this might be possible. This is a typical question of, is better calculate or memoize? Performance, memory usage, and code readability need to be considered. Having said all that I don't think it will make much difference in performance/memory usage so please go ahead if you would like to make that change.

seanyoung (Fri, 30 Jul 2021 22:05:30 GMT):
(I don't know why rocketchat puts the reply above the quoted text, that makes it very unreadable!)

seanyoung (Fri, 30 Jul 2021 22:13:23 GMT):
Hmm I'll have back to this tomorrow, it's getting late here. The modified is something to do with arrays (memory/storage). If any part of the array is modified, then we set modified to true. But I can't recall exactly why (a comment would have helped here!)

seanyoung (Sat, 31 Jul 2021 09:49:01 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=JpgxthQN9KmZmoFsj) I think it should be `SyntaxError`. I added the `ErrorType` just for completeness; I don't know if this is really useful information. What do you think?

seanyoung (Sat, 31 Jul 2021 09:49:46 GMT):
I mean, who is going to be interested in an diagnostic categorisation?

lucasste (Mon, 02 Aug 2021 19:31:50 GMT):
An undefined variable does not look like a syntax error :thinking:

lucasste (Mon, 02 Aug 2021 19:32:10 GMT):
I wanted to add for completeness

lucasste (Mon, 02 Aug 2021 19:33:30 GMT):
Does a false boolean mean that the reaching definition is outdated?

lucasste (Mon, 02 Aug 2021 20:03:43 GMT):
I am going to implement a "recurse" method for `codegen::Instr`, as I need to check each instruction for undefined variable. I think that this ways the code is consistent with `ast::expression`

lucasste (Mon, 02 Aug 2021 20:12:06 GMT):
Do you have any roadmap for Solang?

lucasste (Mon, 02 Aug 2021 20:12:06 GMT):
Is there any roadmap for Solang?

lucasste (Mon, 02 Aug 2021 20:32:03 GMT):
An undefined variable may be used more than once. Should I raise a warning for each usage?

lucasste (Mon, 02 Aug 2021 21:02:08 GMT):
In `codege::Instr`, every reference to an `Expression` is the value itself, except in `Instr::PushMemory` where `Expression` is in a Box

lucasste (Mon, 02 Aug 2021 21:03:18 GMT):
Shouldn't we maintain coherence between all the types inside `Instr`?

seanyoung (Tue, 03 Aug 2021 07:33:35 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=FRajL5iyLkJkuCr9n) This is to reduce the size of the enum. If you remove the box, clippy will give some warning about "very large enum element".

seanyoung (Tue, 03 Aug 2021 07:34:51 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=C2Z9vXXwwZtbJBBT9) I think ideally the compiler diagnostics mention each undefined usage, but I'm open to suggestions. Maybe one diagnostics with multiple notes attached?

seanyoung (Tue, 03 Aug 2021 07:37:29 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=w6hetg5wZX63CQXsg) Let me get back to you on this, there will be a discussion about this at solana tonight.

seanyoung (Tue, 03 Aug 2021 09:34:54 GMT):
ok I've figure it out (I should really add a comment). Consider this contract: ``` contract foo { function modified() public returns (byte) { // here x remains a dynamic allocation after vector_to_slice bytes x = "ABCD"; x[1] = 65; return x[0]; } function not_modified() public returns (byte) { // here x becomes a slice after vector_to_slice bytes x = "ABCD"; return x[0]; } } ``` Now the vector_to_slice pass uses the boolean to decide whether a vector allocation can be reduced to a slice. So a slice a straight const array in program code. A vector is a malloc plus copy from program code. The algorithm the vector_to_slice uses is "is there any reaching definition for variable x which is modified, or a return value, or passed into a function".

seanyoung (Tue, 03 Aug 2021 09:35:21 GMT):
Clearly this could be updated to be more general. It was more of an experiment and it useful in limited ways

lucasste (Tue, 03 Aug 2021 20:53:16 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=kFRqXjxTLaizRoqWy) You said this here, but this morning you told me to raise an error in both cases.

lucasste (Tue, 03 Aug 2021 22:09:52 GMT):
Can I "prettify" the warnings? ``` /Users/lucassteuernagel/Documents/solang/examples/test.sol:5:13-14: error: Variable 'a' is undefined Line 4: int a; ^^^^^^ /Users/lucassteuernagel/Documents/solang/examples/test.sol:14:17-18: note: Variable read before being defined. Line 13: int b = a; ^^^^^^^^^^ /Users/lucassteuernagel/Documents/solang/examples/test.sol:14:13-14: error: Variable 'b' is undefined Line 13: int b = a; ^^^^^^^^^^ /Users/lucassteuernagel/Documents/solang/examples/test.sol:15:16-17: note: Variable read before being defined. Line 14: return b; ^^^^^^^^^ ```

lucasste (Tue, 03 Aug 2021 22:12:43 GMT):
If we use this crate: https://github.com/mackwic/colored I can add colors to warnings

seanyoung (Wed, 04 Aug 2021 08:35:45 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=iqm7j32o92zT2h2fz) Here I also wrote that there should be an error in both cases.

seanyoung (Wed, 04 Aug 2021 08:36:09 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=Sjtqi3Z2wMyDJgfZ7) Please do, that would be nice :blond-haired_man_light_skin_tone:

seanyoung (Wed, 04 Aug 2021 08:38:23 GMT):
This morning I've been looking for documentation that says what is permitted or not. I can't find anything unfortunately. However: ``` contract foo { // This is permitted (returns 0) function f1() public returns (int r) {} // This is not permitted function f2() internal returns (bytes storage r) {} // This is permitted function f3() internal returns (bytes memory r) {} } ``` Anything that is a reference to storage, cannot be undefined, ever. This would cause a storage corruption.

seanyoung (Wed, 04 Aug 2021 08:39:33 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=XS6RXq4jMns8mgrgR) So we had a discussion on this last night at Solana. The focus is to make uniswap fully functional on Solana for now. There are some gaps in the functionality.

lucasste (Wed, 04 Aug 2021 14:01:54 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=2qr6eJ4MturFxH5mA) What is uniswap?

lucasste (Wed, 04 Aug 2021 14:09:36 GMT):
When are you planning to release Solang v0.1.8?

seanyoung (Wed, 04 Aug 2021 20:53:01 GMT):
uniswap is probably one of the most famous solidity contracts. So you can create a cryptocurrency with an ERC20 contract; uniswap allows you to exchange between crypto currencies entirely in smart contracts - no cryptocurrency exchange needed.

seanyoung (Wed, 04 Aug 2021 20:53:36 GMT):
I'd like to do a solang 0.1.8 fairly soon. Probably when uniswap is working. It would be nice to have your parts in there too.

lucasste (Wed, 04 Aug 2021 21:40:28 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=E5FYAPHHeaDBAsucq) "uniswap allows you to exchange between crypto currencies entirely in smart contracts - no cryptocurrency exchange needed." This sounds confusing. It allows me to exchange between crypto currencies, but no exchange is needed?

lucasste (Wed, 04 Aug 2021 22:02:37 GMT):
``` /Users/lucassteuernagel/Documents/solang/tests/codegen_testcases/unused_variable_elimination.sol:106:28-30: error: Variable 't2' is undefined Line 106: testStruct storage t2 = t1; -------------------^^ /Users/lucassteuernagel/Documents/solang/tests/codegen_testcases/unused_variable_elimination.sol:107:9-11: note: Variable read before being defined Line 107: t2.a = 5; ```

lucasste (Wed, 04 Aug 2021 22:02:48 GMT):
Your reaching definitions do need some tweaks

seanyoung (Thu, 05 Aug 2021 17:15:26 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=z5Zyg73RZTRDRvBQE) I mean an exchange like coinbase.com or so

seanyoung (Thu, 05 Aug 2021 18:30:09 GMT):
@lucasste this paper is interesting, someone is working on a new llvm pass for this https://zwang4.github.io/publications/lctes21.pdf

lucasste (Thu, 05 Aug 2021 18:33:17 GMT):
` pub fn get_storage_slot` returns an `Expression::NumberLiteral` with `Loc(0, 0, 0)`, but it creates an ambiguity as it is also a default initializer for an undefined variable.

lucasste (Thu, 05 Aug 2021 18:33:17 GMT):
` pub fn get_storage_slot` returns an `Expression::NumberLiteral` with `Loc(0, 0, 0)`, but this creates an ambiguity as it is also a default initializer for an undefined variable.

lucasste (Thu, 05 Aug 2021 18:34:22 GMT):
Creating an `Expression::StorageSlot` may be more interesting because we strictly identify what the NumberLiteral is doing

lucasste (Thu, 05 Aug 2021 20:28:19 GMT):
@seanyoung have you ever read about how to carry reaching definitions with vectors?

seanyoung (Thu, 05 Aug 2021 20:29:38 GMT):
Well I re-read the dragon book before writing this code. Did I miss something?

lucasste (Thu, 05 Aug 2021 20:30:29 GMT):
I used the dragon book in my compilers class

lucasste (Thu, 05 Aug 2021 20:32:06 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=h9YawRo69oDbFFah7) I see that you use the boolean to indicate that a vector has been modified. I can also use it in my undefined variable detection code, but I was wondering if there is anyway this feature can be improved.

lucasste (Thu, 05 Aug 2021 20:39:07 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=NewzEsrHc6tiTy2y7) One of the authors is Brazilian :flag_br:

lucasste (Thu, 05 Aug 2021 21:12:15 GMT):
I got this function from `full_example.sol`: ``` function run_queue() public pure returns (uint16) { uint16 count = 0; // no initializer means its 0. int32 n; do { if (get_pid_state(n) == State.Waiting) { count++; } } while (++n < 1000); return count; } ```

lucasste (Thu, 05 Aug 2021 21:12:51 GMT):
`n` is undefined, but your comment says that is zero.

lucasste (Thu, 05 Aug 2021 21:19:53 GMT):
When I create a local `struct` and don't initialize it, it contains default values, right? In this case, should I track if a struct is undefined?

seanyoung (Fri, 06 Aug 2021 10:15:34 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=LhqPvFyJQXLDXXsD5) This comment is because of this code: https://github.com/hyperledger-labs/solang/blob/main/src/codegen/statements.rs#L60-L70 It's not correct but what the code does

seanyoung (Fri, 06 Aug 2021 10:15:46 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=QdrYJcxH5AWATrQxr) That should be undefined.

lucasste (Fri, 06 Aug 2021 10:37:27 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=z9kYskYXCzDiw7vRL) And Enums?

lucasste (Fri, 06 Aug 2021 10:39:29 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=z9kYskYXCzDiw7vRL) A struct can be passed to a function call as a reference. In this case, I think I going to have some headaches fixing the reaching definitions.

lucasste (Fri, 06 Aug 2021 10:39:29 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=z9kYskYXCzDiw7vRL) A struct can be passed to a function call as a reference. In this case, I think I am going to have some headaches fixing the reaching definitions.

seanyoung (Fri, 06 Aug 2021 10:40:02 GMT):
enum should be undefined.

seanyoung (Fri, 06 Aug 2021 10:40:30 GMT):
The current reaching definitions does not work across function calls.

lucasste (Fri, 06 Aug 2021 10:41:04 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=5reTXoReyWpXiW48E) ``` Weekday x; assert(uint(x) == 0); ``` This shouldn't work then

seanyoung (Fri, 06 Aug 2021 16:21:26 GMT):
No, it shouldn't

lucasste (Mon, 09 Aug 2021 18:00:20 GMT):
Strings, arrays and strings are passed by referece in solidity.

lucasste (Mon, 09 Aug 2021 18:00:20 GMT):
Strings, arrays and strings are passed by reference in solidity.

lucasste (Mon, 09 Aug 2021 18:00:20 GMT):
Strings, arrays and structs are passed by reference in solidity.

lucasste (Mon, 09 Aug 2021 18:02:00 GMT):
I am doing some research on how to handle that in reaching definitions

lucasste (Mon, 09 Aug 2021 21:29:55 GMT):
Why `symtable::arguments` is `Vector>` and not `Option>`?

lucasste (Mon, 09 Aug 2021 21:32:31 GMT):
Well, it could be only a `Vector`. If the `Vector` is empty, the function receives no arguments

lucasste (Mon, 09 Aug 2021 21:34:10 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=Ef8AA3BvHemq5PB8G) It looks like arguments can be implicit

lucasste (Mon, 09 Aug 2021 22:43:05 GMT):
I figure out a way to detect that a reference variable has been modified in a function during semantic analysis.

lucasste (Mon, 09 Aug 2021 22:43:41 GMT):
The problem is that if the reference is passed to multiple functions it gets tricky

lucasste (Mon, 09 Aug 2021 22:44:02 GMT):
``` contract test_struct_parsing { struct foo { bool x; uint32 y; } function func2(foo f) private { func(f); } function func(foo f) private { // assigning to f members dereferences f f.x = true; f.y = 64; // assigning to f changes the reference f = foo({ x: false, y: 256 }); } function test() public { foo f; func2(f); assert(f.x == true); assert(f.y == 64); } } ```

lucasste (Mon, 09 Aug 2021 22:44:05 GMT):
Like this

lucasste (Mon, 09 Aug 2021 23:01:11 GMT):
I have three options now:

lucasste (Mon, 09 Aug 2021 23:05:54 GMT):
I have three options now: 1. Consider defined anything passed as a reference. 2. Only check that a reference has been defined in the first level of function calls. My plan is to raise errors only if I am sure that the reference has changed (the variable is pointing to another memory slot before being assigned a value) inside the call. 3. Continue working on checking reference changes in multiple functions calls. I don't think this is worth it, as it seems very rare.

lucasste (Mon, 09 Aug 2021 23:06:14 GMT):
What do you think @seanyoung ?

seanyoung (Tue, 10 Aug 2021 07:48:31 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=Ef8AA3BvHemq5PB8G) If parameter doesn't have a name, it is not accessible. That entry will `None` in that case.

seanyoung (Tue, 10 Aug 2021 07:58:47 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=hxAtBGYfdZdagrSnn) I think passing in an undefined reference to a function call should be an error. If this is not fine-grained enough, we can fix this later.

lucasste (Tue, 10 Aug 2021 13:09:46 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=ttqsXXowvkoHf6cJx) ``` #[test] fn structs_as_ref_args() { let mut runtime = build_solidity( r##" contract test_struct_parsing { struct foo { bool x; uint32 y; } function func(foo f) private { // assigning to f members dereferences f f.x = true; f.y = 64; // assigning to f changes the reference f = foo({ x: false, y: 256 }); // f no longer point to f in caller function f.x = false; f.y = 98123; } function test() public { foo f; func(f); assert(f.x == true); assert(f.y == 64); } }"##, ); runtime.function("test", Vec::new()); } ```

lucasste (Tue, 10 Aug 2021 13:10:47 GMT):
This test fails as `foo f` in function test is undefined. However, it is passed as a reference for function func

lucasste (Tue, 10 Aug 2021 13:10:47 GMT):
This test fails as `foo f` in function test is undefined. However, it is passed as a reference for function func and becomes defined

seanyoung (Wed, 11 Aug 2021 08:42:53 GMT):
I think the correct implementation would be to implement reaching definitions across function calls, which could then be used for more passes. This is more work. It might be best to deal with this problem later, and for now make sure that undefined detection works within functions, and change this test.

lucasste (Wed, 11 Aug 2021 12:31:54 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=nak4r2q4vZi72LzXj) Thanks for the advice! I'll do that

lucasste (Wed, 11 Aug 2021 20:56:42 GMT):
In `diagnostics.rs`, there is the function `message_as_json`. Can the formatted message pushed to the json vector be also the prettified one?

lucasste (Wed, 11 Aug 2021 20:57:14 GMT):
Should I leave there the old `formatted_message` function?

seanyoung (Wed, 11 Aug 2021 22:02:49 GMT):
Ehm, I think let's put the pretty-printed version there too. It's much nicer. If this is problem, we can fix this later.

seanyoung (Wed, 11 Aug 2021 22:03:08 GMT):
The only user I know is burrow, and that should print it fine.

lucasste (Thu, 12 Aug 2021 17:16:01 GMT):
The new pretty-printed string has `\n` and `\t`. I wondered if that would break whatever parses the json later

seanyoung (Thu, 12 Aug 2021 18:25:24 GMT):
The json serializer should deal with that correctly.

lucasste (Thu, 12 Aug 2021 21:25:37 GMT):
https://github.com/hyperledger-labs/solang/blob/1b1fccd8cb5de1378b37b18399d39e05ac4b0426/src/codegen/mod.rs#L45 I think there is something missing in that comment

seanyoung (Thu, 12 Aug 2021 21:39:57 GMT):
hmm I must have got distracted while writing that comment

seanyoung (Thu, 12 Aug 2021 21:40:50 GMT):
I think I got distracted because I didn't know what I was thinking was right. :)

seanyoung (Thu, 12 Aug 2021 21:41:39 GMT):
say you have `a.sol` which imports `b.sol`. `b.sol` defines a contract `x`. Now if you do `solang a.sol`, should `x` be emitted?

seanyoung (Thu, 12 Aug 2021 21:42:01 GMT):
if you wanted `x` you would have added `b.sol` to the solang command line.

seanyoung (Thu, 12 Aug 2021 21:42:36 GMT):
However, at the moment, solang will generate code for all contracts it comes across, even in imported files.

seanyoung (Thu, 12 Aug 2021 21:43:02 GMT):
So the thinking was, no reason to generate a cfg for imported contracts. But then I realised that was not implemented at all.

seanyoung (Thu, 12 Aug 2021 21:44:03 GMT):
Not sure what the right answer is here. Either way, I'll update the comment tomorrow

seanyoung (Thu, 12 Aug 2021 21:45:55 GMT):
also, we now do additional checks during codegen which is useful

seanyoung (Fri, 13 Aug 2021 18:45:55 GMT):
I've updated the comment.

nits2k (Sun, 15 Aug 2021 02:45:49 GMT):
Has joined the channel.

nits2k (Sun, 15 Aug 2021 02:45:49 GMT):
Hi

nits2k (Sun, 15 Aug 2021 02:46:05 GMT):
Would be great if someone could ping in asap

nits2k (Sun, 15 Aug 2021 02:47:20 GMT):
I'd like to know if I could use a solang to create a llvm and then deploy it on solana

nits2k (Sun, 15 Aug 2021 02:47:52 GMT):
Also does solang support compilation of ERC-721 and ERC-1155 contracts?

seanyoung (Sun, 15 Aug 2021 15:43:34 GMT):
Hi

seanyoung (Sun, 15 Aug 2021 15:47:13 GMT):
So the solana target is under heavy development right now. - uniswap is working: https://github.com/seanyoung/uniswap-v2-core/ (this needs https://github.com/solana-labs/solana/pull/18328, I'm working on that) - ERC-721 and ERC-1155 contracts should work, but might need minor modifications. - A client library is really needed (else the transactions have to be built by hand): https://github.com/solana-labs/solana-solidity.js/issues/1, there will a bounty on this shortly

seanyoung (Sun, 15 Aug 2021 15:47:48 GMT):
If you have an ERC-721/ERC-1166 contract that isn't compiling, please let me know and we can work through it

lucasste (Sun, 15 Aug 2021 19:42:48 GMT):
``` contract other { int public a; } contract testing { function test(int x) public returns (int) { other o; do { x--; o = new other(); }while(x > 0); return o.a(); } } ``` This code is crashing solang with the error: `thread 'main' panicked at 'internal error: entered unreachable code', src/codegen/statements.rs:1244:18`

seanyoung (Sun, 15 Aug 2021 21:18:15 GMT):
This problem is `other o;` calling ty.default(ns) on a contract type goes to unreachable. https://github.com/hyperledger-labs/solang/blob/main/src/codegen/statements.rs#L75-L85

seanyoung (Sun, 15 Aug 2021 21:18:29 GMT):
Ideally we can get rid of this code once your work is done.

seanyoung (Sun, 15 Aug 2021 21:20:49 GMT):
For now, I've fixed it here https://github.com/hyperledger-labs/solang/pull/467

lucasste (Mon, 16 Aug 2021 13:48:43 GMT):
Hmmm, I left the default initialization there. A better solution is creating an `Expression::Undefined` in that line.

lucasste (Mon, 16 Aug 2021 14:08:33 GMT):
``` contract AddNumbers { function add(uint256 a, uint256 b) external pure returns (uint256 c) {c = b;} } contract Example { AddNumbers addContract; event StringFailure(string stringFailure); event BytesFailure(bytes bytesFailure); function exampleFunction(uint256 _a, uint256 _b) public returns (bytes c) { bytes r; try addContract.add(_a, _b) returns (uint256 _value) { r = hex"ABCD"; return r; } catch Error(string memory _err) { r = hex"ABCD"; emit StringFailure(_err); } catch (bytes memory _err) { emit BytesFailure(_err); } return r; } } ``` In this case, the reaching definitions doesn't detect `r` as undefined. Is this the expected behavior?

seanyoung (Mon, 16 Aug 2021 14:10:04 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=a6wiYTS5F7oHMYGG9) yes, I agree.

seanyoung (Mon, 16 Aug 2021 14:10:43 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=jqdqN7FriQn5k6nF8) That's not expected. r will be undefined if it goes to the last catch block

lucasste (Mon, 16 Aug 2021 17:18:53 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=gLxqkhSiCqmH8CZAK) ``` # function Example::Example::function::exampleFunction__uint256_uint256 public:true selector:ba716ef3 nonpayable:true # params: uint256,uint256 # returns: bytes block0: # entry ty:uint256 %_a = (arg #0) ty:uint256 %_b = (arg #1) ty:bytes %c = (alloc bytes len uint32 0) ty:bytes %r = %temp.11 = load storage slot(uint256 0) ty:contract AddNumbers %success.temp.10 = external call::regular address:(builtin ExternalFunctionAddress (external %temp.11 address function AddNumbers.add)) payload:(abiencode packed:(builtin ExternalFunctionSelector (external %temp.11 address function AddNumbers.add)) non-packed:(arg #0), (arg #1)) value:uint128 0 gas:uint64 0 branchcond %success.temp.10, block1, block2 block1: # success # reaching: _b:[0:1], _a:[0:0], success.temp.10:[0:5], r:[0:3], temp.11:[0:4], c:[0:2] %_value = (abidecode:(%(external call return data), (uint256)) ty:bytes %r = (alloc bytes uint32 2 hex"abcd") branch block3 block2: # catch # reaching: _b:[0:1], temp.11:[0:4], _a:[0:0], r:[0:3], c:[0:2], success.temp.10:[0:5] %_err = (abidecode:(%(external call return data), selector:0x08c379a0 exception: block4 (string)) ty:bytes %r = (alloc bytes uint32 2 hex"abcd") emit event Example.StringFailure topics data %_err branch block3 block3: # finally # phis: r # reaching: _a:[0:0], r:[1:1, 2:1, 4:1], _err:[2:0], success.temp.10:[0:5], _err:[4:0], _b:[0:1], c:[0:2], temp.11:[0:4], _value:[1:0] return %r block4: # no_reason # reaching: c:[0:2], success.temp.10:[0:5], _a:[0:0], _err:[2:0], r:[2:1], temp.11:[0:4], _b:[0:1] ty:bytes %_err = (external call return data) ty:bytes %r = (alloc bytes uint32 2 hex"abcd") emit event Example.BytesFailure topics data %_err branch block3 ```

lucasste (Mon, 16 Aug 2021 17:19:29 GMT):
This is the CFG for this function. Apparently, there is no `branch block 4`

lucasste (Mon, 16 Aug 2021 17:19:44 GMT):
I couldn't find the entry point for block 5

lucasste (Mon, 16 Aug 2021 17:19:44 GMT):
I couldn't find the entry point for block 4

lucasste (Mon, 16 Aug 2021 17:59:08 GMT):
I think there is something wrong in the way this blocks are linked to each other. Reaching definitions show `r[2:1]` for block 4, but if we are at block 4, we certainly haven't gone through the instructions of block 2.

lucasste (Mon, 16 Aug 2021 19:43:44 GMT):
Hey @seanyoung , I still have to find a solution for this issue with try-catch, but while I was waiting for your response, I opened a draft PR: https://github.com/hyperledger-labs/solang/pull/468

seanyoung (Mon, 16 Aug 2021 21:23:06 GMT):
Great! I'll have a look at the pr tomorrow.

lucasste (Tue, 17 Aug 2021 12:42:28 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=b6uB8kvHgp2MCwnHw) Hey @seanyoung , Can you take a look at this?

lucasste (Tue, 17 Aug 2021 18:42:45 GMT):
Codegen links block 2 to block 4. This way the reaching definitions considers that we have gone through the instructions of block 2 before executing block 4.

lucasste (Tue, 17 Aug 2021 18:43:53 GMT):
What is the best way to fix this?

lucasste (Tue, 17 Aug 2021 19:32:12 GMT):
I could think of two possibilities: 1. Add `try_catch_error: Option` to `Instr::BranchCond`. This way I can link block 0 to block 4 during reaching definitions. 2. Create a `Instr::TryCatch`, with `cond: Expression`, `success_block: usize`, `error_block_1: usize`, `error_block_2: Option`. This makes more sense to me, but `error_block_2` serves only to signal reaching definitions of another block. The actual work is done by `AbiDecode`.

lucasste (Tue, 17 Aug 2021 19:34:52 GMT):
3. Change `AbiDecode` to return a `success` variable, so that we can branch the code using `BranchCond`

seanyoung (Wed, 18 Aug 2021 07:59:18 GMT):
So there is a bit of a hack in `Instr::AbiDecode`. There is an exception field, which branches to block4.

seanyoung (Wed, 18 Aug 2021 08:00:49 GMT):
This branch is followed if abi decoding fails. This also means that the branch will happen from the not-last-instruction of the block. I think this is what messes up the reaching definitions -- I think the code assumes the branch happens from the last block.

seanyoung (Wed, 18 Aug 2021 08:02:30 GMT):
This hack exists because of the code gen. The generated abi decoder can encounter problems in various cases (not enough input, input value does not make sense, trailing input). All these cases need a branch out of the code.

seanyoung (Wed, 18 Aug 2021 08:07:39 GMT):
When the exception branch is followed, none of the of the decoded values are valid, they should all be undefined. I'm not sure how this can be represented in the CFG. In actual fact I think the right solution is to re-write the abi decoder in CFG instructions, rather than building it using llvm. So, in other words, `Instr::AbiDecode` is too complex. This is way beyond the scope of your work so lets leave this for now.

seanyoung (Wed, 18 Aug 2021 08:33:53 GMT):
I guess another way to solve this is to make reaching definitions work with branches which is not the last instruction. This is a bit of hack anyway so probably not worth it

lucasste (Wed, 18 Aug 2021 13:00:03 GMT):
`loc.0` is the file number. But when we invoke `solang *.sol`, we build multiple files that are not necessarily linked to each other. For instance, if we invoke `solang test1.sol test2.sol` and `test1.sol` and `test2.sol` are independent from each other, we are going to have two equals`loc.0` in namespace, but they cannot be used to locate files in `FileCache`

lucasste (Wed, 18 Aug 2021 13:00:03 GMT):
`loc.0` is the file number. But when we invoke `solang *.sol`, we build multiple files that are not necessarily linked to each other. For instance, if we invoke `solang test1.sol test2.sol` and `test1.sol` and `test2.sol` are independent from each other, we are going to have two `loc.0 == 0` in namespace, but they cannot be used to locate files in `FileCache`

lucasste (Wed, 18 Aug 2021 13:01:52 GMT):
`loc.0` is going to be zero for both `test1.sol` and `test2.sol`

lucasste (Wed, 18 Aug 2021 13:25:20 GMT):
This is what is breaking the integration tests

lucasste (Wed, 18 Aug 2021 13:52:38 GMT):
I added a `cache_no: usize` inside `struct File` to solve this.

lucasste (Wed, 18 Aug 2021 14:49:06 GMT):
I updated my PR. I think it is ready for review now: https://github.com/hyperledger-labs/solang/pull/468

seanyoung (Thu, 19 Aug 2021 12:57:31 GMT):
Merged

seanyoung (Tue, 24 Aug 2021 17:59:22 GMT):
Hyperledger has an arm mac runner, so we can run tests and releases on arm mac now! https://github.com/hyperledger-labs/solang/pull/477

seanyoung (Tue, 24 Aug 2021 18:01:48 GMT):
I'm building llvm 12 so that solang can move to llvm 12 soon. https://github.com/hyperledger-labs/solang/actions/workflows/build-llvm.yml

seanyoung (Tue, 24 Aug 2021 18:20:38 GMT):
Solang needs an npm package to make it work on Solana. There is a 25k USD bounty to make this happen: https://gitcoin.co/issue/solana-labs/solana-solidity.js/1/100026404

seanyoung (Fri, 27 Aug 2021 09:10:52 GMT):
Solang now uses llvm 12.

seanyoung (Fri, 27 Aug 2021 09:11:41 GMT):
I think that since we have arm mac binaries, and we've moved to llvm 12, and lots of stuff has happened since the last release, it's time to do a release.

seanyoung (Fri, 27 Aug 2021 09:12:02 GMT):
That way the vscode extension can also pick up the arm mac binary.

lucasste (Fri, 27 Aug 2021 13:28:51 GMT):
Do I need to re-build llvm then?

lucasste (Fri, 27 Aug 2021 13:29:40 GMT):
Have you update the docs with the corresponding branch to build from sources?

lucasste (Fri, 27 Aug 2021 13:29:40 GMT):
Have you updated the docs with the corresponding branch to build from sources?

seanyoung (Fri, 27 Aug 2021 16:39:06 GMT):
@lucasste the documentation is updated with instructions for llvm 12. Also, the release also builds llvm and adds them as release assets: https://github.com/hyperledger-labs/solang/releases/tag/v0.1.8 so you can download llvm from there too.

seanyoung (Fri, 27 Aug 2021 16:39:51 GMT):
@here solang v0.1.8 has been released: https://github.com/hyperledger-labs/solang/releases/tag/v0.1.8 The visual studio extension has also been updated: https://marketplace.visualstudio.com/items?itemName=solang.solang

ohthemboats (Wed, 01 Sep 2021 08:30:08 GMT):
Has joined the channel.

ohthemboats (Wed, 01 Sep 2021 08:30:08 GMT):
Good day! Would like to ask a few questions about compiling to Solana. I wonder whether it is currently possible to compile ERC-20 contracts, it seems like you need to tweak the library a little bit (to get rid of assembly and change the int sizes for native tokens) Also I wonder whether it is possible to call directly into Solana programs from Solidity and, if so, how? Say, to use, `spl-token` directly. And the last one, it would be nice to look at some more-or-less big OS projects currently using Solang as a compiler.

ohthemboats (Wed, 01 Sep 2021 08:30:08 GMT):
Good day! Would like to ask a few questions about compiling to Solana. I wonder whether it is currently possible to compile ERC-20 contracts, it seems like you need to tweak the library a little bit (to get rid of assembly and change the int sizes for native tokens). Maybe someone has already done this? Also I wonder whether it is possible to call directly into Solana programs from Solidity and, if so, how? Say, to use, `spl-token` directly. And the last one, it would be nice to look at some more-or-less big OS projects currently using Solang as a compiler.

seanyoung (Wed, 01 Sep 2021 08:34:10 GMT):
@ohthemboats you're right, there are minor tweaks needed to make contracts work using solang. Let me know if you need any help doing this. Calling into solana programs and `spl-token` compatibility is not there yet, but it's high on priorities list

ohthemboats (Wed, 01 Sep 2021 08:36:47 GMT):
I see. Thank you very much! Also there is one more question about how dynamically sized structures are handled, because account sizes are static in Solana

seanyoung (Wed, 01 Sep 2021 08:39:39 GMT):
When you create a contract on Solana, you can specify the size of the account with `space`, like `Foo f = new foo{space: 2048}();`. The runtime creates a data structures in the account data for handling dynamic fields (hashmap)

ohthemboats (Wed, 01 Sep 2021 08:44:21 GMT):
Thank you! I'll try to tweak the library a bit and will ask any questions which might come up

seanyoung (Wed, 01 Sep 2021 08:44:49 GMT):
Great! Please let me know how you get on.

ohthemboats (Thu, 02 Sep 2021 13:52:14 GMT):
Oh, there were some problems, I couldn't use selector calls at all (which are used quite heavily in the library), like here https://github.com/OpenZeppelin/openzeppelin-contracts/blob/fa64a1ced0b70ab89073d5d0b6e01b0778f7e7d6/contracts/token/ERC20/SafeERC20.sol#L23 With this error ``` # solang contracts/MyContract.sol --target=solana 2>&1 | grep error /home/sheep/Documents/solidity/openzeppelin-contracts/contracts/token/ERC20/SafeERC20.sol:23:65-73: error: contract ‘IERC20’ has no public function ‘transfer’ ``` Then after trying to comment everything out (just to see the thing build at first) my own Solidity code wasn't able to use the library with this error: ``` using SafeERC20 for IERC20; ``` ``` λ solang contracts/MyContract.sol --target=solana 2>&1 | grep error /home/sheep/Documents/solana/solang-test/contracts/MyContract.sol:16:11-20: error: using library ‘SafeERC20’ to extend interface type not possible ```

ohthemboats (Thu, 02 Sep 2021 13:52:14 GMT):
Oh, there were some problems, I couldn't use selector calls at all (which are used quite heavily in the library), like here https://github.com/OpenZeppelin/openzeppelin-contracts/blob/fa64a1ced0b70ab89073d5d0b6e01b0778f7e7d6/contracts/token/ERC20/SafeERC20.sol#L23 With this error ``` # solang contracts/MyContract.sol --target=solana 2>&1 | grep error /home/sheep/Documents/solidity/openzeppelin-contracts/contracts/token/ERC20/SafeERC20.sol:23:65-73: error: contract ‘IERC20’ has no public function ‘transfer’ ``` Then after trying to comment everything out (just to get the thing to build first) my own Solidity code wasn't able to use the library with this error: ``` using SafeERC20 for IERC20; ``` ``` λ solang contracts/MyContract.sol --target=solana 2>&1 | grep error /home/sheep/Documents/solana/solang-test/contracts/MyContract.sol:16:11-20: error: using library ‘SafeERC20’ to extend interface type not possible ``` Is this fixable?

seanyoung (Thu, 02 Sep 2021 15:55:00 GMT):
Sure this should be fixable. @ohthemboats would you mind sending the sol files please?

ohthemboats (Fri, 03 Sep 2021 09:00:36 GMT):
Thank you very much! Here is the simplest reproducible example! https://github.com/sushi-shi/ReproducibleExample This code here is commented, because `.selector` didn't work. https://github.com/sushi-shi/ReproducibleExample/blob/master/ERC20/SafeERC20.sol#L23 Then there is this, which won't let me import the library https://github.com/sushi-shi/ReproducibleExample/blob/master/MyContract.sol#L11 Because of which this function is not recognized https://github.com/sushi-shi/ReproducibleExample/blob/master/MyContract.sol#L25

ohthemboats (Fri, 03 Sep 2021 09:11:26 GMT):
Also do I understand correctly that `block.number` will never be implemented, as you can't really get it in Solana? https://docs.solana.com/developing/runtime-facilities/sysvars

seanyoung (Fri, 03 Sep 2021 09:23:59 GMT):
So missing `.selector` is an oversight. I'll add that today and look at the other issues.

seanyoung (Fri, 03 Sep 2021 09:24:58 GMT):
As for `block.number` you're right that is an issue. I'm not sure what to do about that, I'll ask around at solana (discord)

ohthemboats (Fri, 03 Sep 2021 09:28:02 GMT):
Thanks!

seanyoung (Fri, 03 Sep 2021 17:37:19 GMT):
So I've started on the selector stuff, I'm having to refactor some code to make this work properly. https://github.com/hyperledger-labs/solang/pull/486

seanyoung (Fri, 03 Sep 2021 17:38:07 GMT):
on `block.number` there was a discussion on solana discord #development and so far, I've been told that the slot is what you want to use

seanyoung (Fri, 03 Sep 2021 17:38:07 GMT):
on `block.number` there was a discussion on solana discord #development and so far, it looks like the slot is what we want to use

seanyoung (Sat, 04 Sep 2021 11:04:50 GMT):
I've merged the selector fix. I'm now looking at the import library issue. Looks like the `using` does not support interface types, I was not aware solidity allows this. I've started working on a fix for that.

scnale (Sun, 05 Sep 2021 23:40:07 GMT):
Has joined the channel.

seanyoung (Mon, 06 Sep 2021 09:56:08 GMT):
@ohthemboats I have a fix for the issue on line https://github.com/sushi-shi/ReproducibleExample/blob/master/MyContract.sol#L11 here https://github.com/hyperledger-labs/solang/pull/488

seanyoung (Mon, 06 Sep 2021 16:05:03 GMT):
@scnale interesting observation that the compiler isn't deterministic. I've made some modifications, and now it should be https://github.com/hyperledger-labs/solang/pull/490

seanyoung (Mon, 06 Sep 2021 16:06:20 GMT):
``` $ while true; do ~/git/solang/target/debug/solang ../contracts/*.sol --target solana 2> /dev/null && md5sum bundle.so; done5714aee9edc1848cdb283b57a1e01f35 bundle.so 5714aee9edc1848cdb283b57a1e01f35 bundle.so 5714aee9edc1848cdb283b57a1e01f35 bundle.so 5714aee9edc1848cdb283b57a1e01f35 bundle.so 5714aee9edc1848cdb283b57a1e01f35 bundle.so 5714aee9edc1848cdb283b57a1e01f35 bundle.so ```

lucasste (Tue, 07 Sep 2021 20:47:39 GMT):
I'm thinking of treating the GEN set (of expressions) as a graph that contains each sub expression. For instance, if we have `k = a + b -c*d`, the tree would be: ``` (a, b, +) (c, d, *) => roots ```

lucasste (Tue, 07 Sep 2021 20:47:39 GMT):
I'm thinking of treating the GEN set (of expressions) as a graph that contains each sub expression. For instance, if we have `k = a + b -c*d`, the tree would be: ``` (a, b, +) (c, d, *) => roots \ / (e1, e2, -) ```

lucasste (Tue, 07 Sep 2021 20:47:39 GMT):
I'm thinking of treating the GEN set (of expressions) as a graph that contains each sub expression. For instance, if we have `k = a + b -c*d`, the tree would be: ``` (a, b, +) (c, d, *) => roots \ / (e1, e2, -) ```

lucasste (Tue, 07 Sep 2021 20:47:39 GMT):
I'm thinking of treating the GEN set (of expressions) as a graph that contains each sub expression. For instance, if we have `k = a + b -c*d`, the tree would be: ``` (a, b, +) (c, d, *) \ / (e1, e2, -) ```

lucasste (Tue, 07 Sep 2021 20:47:39 GMT):
I'm thinking of treating the GEN set (of expressions) as a graph that contains each sub expression. For instance, if we have `k = a + b -c*d`, the graph would be: ``` (a, b, +) (c, d, *) \ / (e1, e2, -) ```

lucasste (Tue, 07 Sep 2021 20:47:39 GMT):
I'm thinking of treating the GEN set (of expressions) as a DAG that contains each sub expression. For instance, if we have `k = a + b -c*d`, the graph would be: ``` (a, b, +) (c, d, *) \ / (e1, e2, -) ```

lucasste (Tue, 07 Sep 2021 20:48:55 GMT):
e1 and e2 represnt the operands of the the subtraction operation

lucasste (Tue, 07 Sep 2021 20:48:55 GMT):
e1 and e2 represnt the operands of the the subtraction operation. Edges are directed from `(a, b, +)` and `(c, d, *)` to `(e1, e2, -)`

lucasste (Tue, 07 Sep 2021 20:49:45 GMT):
If `a` is redefined, I would eliminate nodes `(a, b, +)` and `(e1, e2, -)`

lucasste (Tue, 07 Sep 2021 20:50:52 GMT):
If we see `k2 = c*d-a`, the node `(c, d, *)` is still at the three (if the reaching definitions for c and d are the same)

lucasste (Tue, 07 Sep 2021 20:50:52 GMT):
If we see `k2 = c*d-a`, the node `(c, d, *)` is still at the graaph (if the reaching definitions for c and d are the same)

lucasste (Tue, 07 Sep 2021 20:51:03 GMT):
So we would only need to add one node.

lucasste (Tue, 07 Sep 2021 20:52:22 GMT):
To be possible to merge graphs after a branch, I am thinking of assigning each node a UUID. Nodes with the same UUID after a branch have not changed.

lucasste (Tue, 07 Sep 2021 20:52:35 GMT):
Can I add the UUID crate to solang?

lucasste (Tue, 07 Sep 2021 22:57:17 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=jT3WtTmEcujmzRpno) Another option would be maintaining a global integer that counts the number of created nodes

ohthemboats (Wed, 08 Sep 2021 08:23:27 GMT):
@seanyoung Thank you very much! There are still problems with selectors, as some assertions in llvm code fail. https://github.com/sushi-shi/ReproducibleExample/blob/master/MyContract.sol#L25 ``` solang: llvm/lib/IR/Instructions.cpp:1437: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed. ```

seanyoung (Wed, 08 Sep 2021 08:41:55 GMT):
@lucasste UUID are useful for uniqueness across processes and or machines, it's a bit expensive for in-process uniqueness. Like you said a counter would work fine for in-process.

seanyoung (Wed, 08 Sep 2021 08:44:00 GMT):
I like your idea of making this a directed graph. I think this is quite original, I have not seen this before.

seanyoung (Wed, 08 Sep 2021 08:44:24 GMT):
@ohthemboats oh dear I thought I had tested that!

seanyoung (Wed, 08 Sep 2021 08:48:17 GMT):
@ohthemboats oops that is broken.

seanyoung (Wed, 08 Sep 2021 13:56:05 GMT):
@ohthemboats ok I've debugged the issue. The problem is that return data from `

.call()` is not handled correctly. This will be fixed by https://github.com/hyperledger-labs/solang/pull/485

seanyoung (Wed, 08 Sep 2021 13:56:20 GMT):
Let me work on that PR.

lucasste (Thu, 09 Sep 2021 22:51:16 GMT):
If a contract variable and a local variable have the same name, Solidity uses the local one, right? Does the AST already handles this case?

lucasste (Fri, 10 Sep 2021 11:14:13 GMT):
I may need to simplify the available expression, because I cannot track storage variables, struct members and vectors usage. Reaching definitions does not work across function calls, so I do not know if a function call changes the value of a storage variable that has been used in an expression. In addition, the reaching definitions does not track the value of vector items.

lucasste (Fri, 10 Sep 2021 11:14:44 GMT):
Do we track struct member in reaching definitions?

lucasste (Fri, 10 Sep 2021 11:14:44 GMT):
Do we track struct members in reaching definitions?

lucasste (Fri, 10 Sep 2021 12:18:24 GMT):
What is ZeroExt, SignExt and UnaryMinus?

lucasste (Fri, 10 Sep 2021 12:18:59 GMT):
Should I track operations such as Trunc, Cast, BytesCast and Not?

lucasste (Fri, 10 Sep 2021 12:20:11 GMT):
Tracking StringCompare and StringConcat seem a good idea as they are expensive operations, but only when their arguments are variables for I cannot keep track of compile time constants.

lucasste (Fri, 10 Sep 2021 12:20:11 GMT):
Tracking StringCompare and StringConcat seems a good idea as they are expensive operations, but only when their arguments are variables for I cannot keep track of compile time constants.

seanyoung (Sat, 11 Sep 2021 07:28:26 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=GSwHtbdPu7vP6pdDB) Yes, it does.

seanyoung (Sat, 11 Sep 2021 07:29:22 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=ooXhxPXeAM4tWAx2K) No, the current reaching definitions does not track that. This is an improvement which will need to be added at some point.

seanyoung (Sat, 11 Sep 2021 07:30:18 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=tkwiuxjpkvg5N6QBS) Yes, there is limited time and implementing of all this will take a lot of time.

seanyoung (Sat, 11 Sep 2021 07:31:57 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=2xwvn8PLa3XqAfRJW) If you cast an unsigned int to a wider unsigned int then that's a zeroext (zero extension). Eg. `uint16` to `uint64`. If you cast an signed int to a widersigned int then that's a signext (sign extension). Eg. ` UnaryMinus is the minus in `foo = -foo;`

lucasste (Sat, 11 Sep 2021 13:05:50 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=Wkas7NXNoBbqai4X4) @seanyoung ZeroExt, SignExt as well?

lucasste (Sat, 11 Sep 2021 13:06:13 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=zgrHQdp6M4QYJDRQq) Can I assume that UnaryMinus will never appear inside an arithmetic expression?

seanyoung (Mon, 13 Sep 2021 09:02:47 GMT):
UnaryMinus can appear inside an arithmetic expression, "-foo" is an example of that.

seanyoung (Mon, 13 Sep 2021 09:03:24 GMT):
All of these should be tracked as well, but given you have limited time I would say start simple and build out from there. The solution does have to be complete.

lucasste (Mon, 13 Sep 2021 14:12:14 GMT):
`StringCompare` and `StringConcat` does not appear to be native Solidity operations. Can you give an example when they happen?

lucasste (Mon, 13 Sep 2021 14:12:14 GMT):
`StringCompare` and `StringConcat` do not appear to be native Solidity operations. Can you give an example when they happen?

lucasste (Mon, 13 Sep 2021 14:12:47 GMT):
These operations are new on Solang, aren't they? I think I don't track them yet on my other analysis

lucasste (Mon, 13 Sep 2021 14:12:47 GMT):
These operations are new on Solang, aren't they? I think I don't track them yet on my unused and undefined analysis

seanyoung (Mon, 13 Sep 2021 14:13:35 GMT):
They're new in Solang, yes. You can concatenate strings with + and compare two string variables.

lucasste (Mon, 13 Sep 2021 14:14:01 GMT):
Compare them using `==`?

seanyoung (Mon, 13 Sep 2021 14:14:10 GMT):
exactly

seanyoung (Mon, 13 Sep 2021 14:14:17 GMT):
or `!=`

lucasste (Mon, 13 Sep 2021 14:24:51 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=FF28s4yZowYakhus3) I looked at your implementation. Hopefully, I don't need to change anything on unused and undefined variable analysis

lucasste (Mon, 13 Sep 2021 16:43:25 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=KeXQPvZnrGHBmmX8h) I implemented the DAG I told you about. It is expression agnostic, so the implementation is the same for each expressions. The only differentiation I made was commutative (`a +b`), non-commutative (`a*b`) and unary operations (`!var`).

lucasste (Mon, 13 Sep 2021 16:43:25 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=KeXQPvZnrGHBmmX8h) I implemented the DAG I told you about. It is expression agnostic, so the implementation is the same for all expressions. The only differentiation I made was commutative (`a +b`), non-commutative (`a*b`) and unary operations (`!var`).

lucasste (Mon, 13 Sep 2021 16:43:25 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=KeXQPvZnrGHBmmX8h) I implemented the DAG I told you about. It is expression agnostic, so the implementation is the same for all expressions. The only differentiation I made was commutative (`a +b`), non-commutative (`a/b`) and unary operations (`!var`).

lucasste (Mon, 13 Sep 2021 16:44:57 GMT):
I am implementing the Kill operation for the DAG (when a variable is not available any more). After that, I will implement merge (when we exit branches we intersect the available expression sets).

lucasste (Mon, 13 Sep 2021 16:45:11 GMT):
The Gen operation is finished

ohthemboats (Mon, 13 Sep 2021 17:27:42 GMT):
@seanyoung, Good day! Have I done something wrong, or why does this contract fail here? https://github.com/sushi-shi/ReproducibleExample/blob/master/Composition/main.ts#L30 The only difference in `index.ts` is that I split `loadProgram` into `loadProgram` and `getContract` so I could easily swap abi's. https://github.com/sushi-shi/ReproducibleExample/blob/master/Composition/index.ts#L132

ohthemboats (Mon, 13 Sep 2021 17:27:42 GMT):
@seanyoung, Good day! Have I done something wrong, or why does this contract fail here? https://github.com/sushi-shi/ReproducibleExample/blob/master/Composition/main.ts#L30 Here is the contract: https://github.com/sushi-shi/ReproducibleExample/blob/master/Composition/composition.sol The only difference in `index.ts` is that I split `loadProgram` into `loadProgram` and `getContract` so I could easily swap abi's. https://github.com/sushi-shi/ReproducibleExample/blob/master/Composition/index.ts#L132

seanyoung (Mon, 13 Sep 2021 20:57:41 GMT):
@ohthemboats I'l have a look tomorrow

ohthemboats (Tue, 14 Sep 2021 08:54:25 GMT):
It was my mistake, sorry, I forgot to pass an account's pubkey into `call_function`, however when I do pass it I still get an error, telling me that `An account required by the instruction is missing`

ohthemboats (Tue, 14 Sep 2021 08:54:25 GMT):
It was my mistake, sorry, I forgot to pass an account's pubkey into `call_function`, however when I do pass it I still get an error, telling me that `An account required by the instruction is missing` https://github.com/sushi-shi/ReproducibleExample/blob/master/Composition/main.ts#L31

ohthemboats (Tue, 14 Sep 2021 09:05:39 GMT):
And I fixed this as well by calling `all_keys()`, sorry for bothering you

seanyoung (Tue, 14 Sep 2021 09:07:37 GMT):
@ohthemboats glad you got it working, getting all the keys right is tricky. Solana needs to know all the accounts ahead of time, which helps with concurrency/performance. That is needed for the huge transaction throughput solana can do.

ohthemboats (Tue, 14 Sep 2021 14:17:50 GMT):
There is one more problem. Calling `getTimestamp` consumes all compute units. Inlining works, however. https://github.com/sushi-shi/ReproducibleExample/blob/master/TimeMoney/timestamp.sol

seanyoung (Tue, 14 Sep 2021 14:51:27 GMT):
`block.timestamp` is not implemented yet. That can be done at the same time as `block.number`

ohthemboats (Tue, 14 Sep 2021 14:54:47 GMT):
Oh, I thought I saw timestamp implemented in `.../emit/solana.rs`?

ohthemboats (Tue, 14 Sep 2021 14:55:22 GMT):
It is just that it even works (possibly incorrectly) when calling not from a function, but directly

ohthemboats (Tue, 14 Sep 2021 16:05:05 GMT):
Do I understand correctly that it is not possible to get a `String` from `require(Bool, String)` because after a transaction failure no state can be changed?

seanyoung (Tue, 14 Sep 2021 16:07:13 GMT):
@ohthemboats that is correct, however we're super close to getting that fixed. Solana has a new feature return data: https://github.com/solana-labs/solana/pull/19548 On the other side solang has this PR https://github.com/hyperledger-labs/solang/pull/485 That is failing because the solana edge docker image is broken. Anyway when all of this is merged, you can get the string from `require`/`revert`

ohthemboats (Tue, 14 Sep 2021 16:07:36 GMT):
Oh, very nice, thank you!

ohthemboats (Tue, 14 Sep 2021 16:08:14 GMT):
Also how can I check whether an `event` has been emitted? There is this example here, but I don't think it checks for them? https://github.com/hyperledger-labs/solang/blob/main/integration/solana/oznfc.spec.ts

seanyoung (Tue, 14 Sep 2021 16:09:44 GMT):
So events aren't supported yet by Solana. I've been working on this today: https://github.com/solana-labs/solana/pull/19764 This is fairly straightforward, so this should be supported soon (like this/next week or so)

ohthemboats (Fri, 17 Sep 2021 11:55:53 GMT):
With support for calling into solana shipped would it be possible to implement `ERC20` interface in such a way, that it will use `spl-token` underneath?

ohthemboats (Fri, 17 Sep 2021 11:55:53 GMT):
Good day! With support for calling into solana shipped would it be possible to implement `ERC20` interface in such a way, that it will use `spl-token` underneath?

ohthemboats (Fri, 17 Sep 2021 11:59:55 GMT):
I don't think there will be any problems, just that I wonder how the calling interface will look like

seanyoung (Sat, 18 Sep 2021 10:17:03 GMT):
@ohthemboats at the moment this is not possible yet. However, this is such an obvious thing to have, this is high or our priorities list.

seanyoung (Sat, 18 Sep 2021 10:18:54 GMT):
@here for the Solana target, a new mechanism for returning data is now used: https://github.com/hyperledger-labs/solang/pull/485 this means that: - Code must be updated to use the new method (much simpler) - Revert errors are now returned - rpc calls can now be done using `simulateTransaction()`

ohthemboats (Mon, 20 Sep 2021 12:45:01 GMT):
@seanyoung sorry, there is one more question! How much work would have to be done to write backend for cosmwasm in solang? Can any code for ewasm be reused?

seanyoung (Tue, 21 Sep 2021 09:21:18 GMT):
@ohthemboats the major work of supporting a new wasm chain is adding the system calls for all the features, and implementing contract storage. From what I remember cosmwasm uses protobuf encoding for syscalls, so protobuf would have to be added into the compiled wasm. That seems entirely possible, it would have to be compiled to llvm bc files so it can be linked using lto.

seanyoung (Tue, 21 Sep 2021 09:22:12 GMT):
I'm not sure how cosmwasm handled storage though. With Solana, and ewasm two widely different storage systems are supported though.

seanyoung (Tue, 21 Sep 2021 09:23:16 GMT):
Any contributions for cosmwasm would be very welcome and of course I am happy to help with this. It requires some in-depth knowledge of llvm IR and cosmwasm though.

seanyoung (Wed, 22 Sep 2021 12:46:43 GMT):
@lucasste this solidity: ``` contract foo { function f(int a) public { } } ``` $ solang y.sol --emit cfg ``` # function sol::foo::function::f__int256 public:true selector:1c008df9 nonpayable:true # params: int256 # returns: block0: # entry ty:int256 %a = (arg #0) return ```

seanyoung (Wed, 22 Sep 2021 12:47:00 GMT):
`(arg #0)` is Expression::FunctionArg(0)

seanyoung (Wed, 22 Sep 2021 12:47:13 GMT):
This populates the local variable with the function argument

lucasste (Wed, 22 Sep 2021 13:53:45 GMT):
I've noticed that: ``` expr_set.expression_memory.insert(self.global_id_counter, Rc::new(RefCell::new(BasicExpression{ expr_type: ExpressionType::Variable(*var_pos), expression_id: self.global_id_counter, children: Default::default() }))); ``` is not working

lucasste (Wed, 22 Sep 2021 13:54:07 GMT):
Perphaps the RC goes out of scope when the function call returns

lucasste (Wed, 22 Sep 2021 13:54:25 GMT):
The value is not being added to the hashmap

lucasste (Wed, 22 Sep 2021 14:10:58 GMT):
Just found the error

lucasste (Wed, 22 Sep 2021 14:38:52 GMT):
``` ty:int256 %a = (arg #0) ty:int256 %b = (arg #1) ty:int256 %c = ((arg #0) + (arg #1)) ty:int256 %d = ((arg #1) + (arg #0)) return (((arg #0) + (arg #1)) + ((arg #1) + (arg #0))) ```

lucasste (Wed, 22 Sep 2021 14:39:01 GMT):
This example has worked so far

lucasste (Wed, 22 Sep 2021 14:40:12 GMT):
I succesfully find that `arg #0 + arg #1` (as well as `arg 10 + arg #0`) is avaliable

lucasste (Wed, 22 Sep 2021 14:40:12 GMT):
I succesfully find that `arg #0 + arg #1` (as well as `arg #1 + arg #0`) is avaliable

Bertho (Fri, 24 Sep 2021 10:24:37 GMT):
Has joined the channel.

Bertho (Fri, 24 Sep 2021 10:30:36 GMT):
Thanks for your awesome job! Do you think that one day Solana will understand Solidity 100% without compensation? Is the Solana team heading for official Solidity support or not?

Bertho (Fri, 24 Sep 2021 10:30:36 GMT):
Thanks for your awesome job! Do you think that one day Solana will understand Solidity 100% without compensation?

seanyoung (Sat, 25 Sep 2021 06:52:47 GMT):
@Bertho thanks! I assume by compensation you mean whether any solidity file will just compile without modification. First of all, even on ethereum each solidity version changes the syntax, so there is not one "ethereum solidity syntax". Solana and Substrate are just different base layers so they do not support EVM instructions, and there are other differences like the length of an address. So, there will always be differences, although the aim is to minimize those and to provide helpful error messages to the user (that last part still needs work).

lucasste (Sat, 25 Sep 2021 23:29:10 GMT):
I've been testing my available expression implementation with solidity code. I'm thinking about writing some tests for the PR. 1. I can write unit tests for each function. 2. I can just test adding an expression and checking if it is indeed there

seanyoung (Sun, 26 Sep 2021 08:35:27 GMT):
@lucasste what exactly do you have in mind for 1 and 2?

ohthemboats (Sun, 26 Sep 2021 18:00:22 GMT):
@seanyoung Good day! Return statements with function calls and ternary operators returning tuples do not work. Tentatively I tried to fix it myself[1], however I do want to ask what would be the best way to proceed, as of right now `Statement` for `Return` contains inside it a `Vec` of expressions[2], however it might be better to replace it with a simple expression as done in `Destructure`, also the code for return statements is structurally the same as for pattern matching tuples and I wonder whether it can be somehow reused [1]: https://github.com/sushi-shi/solang/commit/0f1c00f1a5edcfcdfff3a61bab3c8fc4fac58d77 [2]: https://github.com/sushi-shi/solang/blob/return/src/sema/ast.rs#L1391

ohthemboats (Sun, 26 Sep 2021 18:00:22 GMT):
@seanyoung Good day! Return statements with function calls and ternary operators returning tuples do not work. Tentatively I tried to fix it myself[1], however I do want to ask what would be the best way to proceed, as of right now `Statement` for `Return` contains inside it a `Vec` of expressions[2], however it might be better to replace it with a simple expression as done in `Destructure`, also the code for return statements is structurally the same as for pattern matching tuples and I wonder whether it can be somehow reused. But it is still a bit different, because return statements can contain simple expression as well [1]: https://github.com/sushi-shi/solang/commit/0f1c00f1a5edcfcdfff3a61bab3c8fc4fac58d77 [2]: https://github.com/sushi-shi/solang/blob/return/src/sema/ast.rs#L1391

ohthemboats (Sun, 26 Sep 2021 18:00:22 GMT):
@seanyoung Good day! Return statements with function calls and ternary operators returning tuples do not work. Tentatively I tried to fix it myself[1], however I do want to ask what would be the best way to proceed, as of right now `Statement` for `Return` contains inside it a `Vec` of expressions[2], however it might be better to replace it with a simple expression as done in `Destructure`, also the code for return statements is structurally the same as for pattern matching tuples and I wonder whether it can be somehow reused. But it is still a bit different, because return statements can contain simple expression as well [1]: https://github.com/sushi-shi/solang/commit/e7f1b4f0b6016e6ed4dbbdea2ad78df77400c1db [2]: https://github.com/sushi-shi/solang/blob/return/src/sema/ast.rs#L1391

ohthemboats (Sun, 26 Sep 2021 18:00:22 GMT):
@seanyoung Good day! Return statements with function calls and ternary operators returning tuples do not work[0]. Tentatively I tried to fix it myself[1], however I do want to ask what would be the best way to proceed, as of right now `Statement` for `Return` contains inside it a `Vec` of expressions[2], however it might be better to replace it with a simple expression as done in `Destructure`, also the code for return statements is structurally the same as for pattern matching tuples and I wonder whether it can be somehow reused. But it is still a bit different, because return statements can contain simple expression as well [0]: https://github.com/sushi-shi/ReproducibleExample/blob/master/2.Ternary.sol [1]: https://github.com/sushi-shi/solang/commit/e7f1b4f0b6016e6ed4dbbdea2ad78df77400c1db [2]: https://github.com/sushi-shi/solang/blob/return/src/sema/ast.rs#L1391

ohthemboats (Sun, 26 Sep 2021 18:00:22 GMT):
@seanyoung Good day! Return statements with function calls and ternary operators returning tuples do not work[0]. Tentatively I tried to fix it myself[1], however I do want to ask what would be the best way to proceed (as codegen and possibly some other things need to be fixed as well), as of right now `Statement` for `Return` contains inside it a `Vec` of expressions[2], however it might be better to replace it with a simple expression as done in `Destructure`, also the code for return statements is structurally the same as for pattern matching tuples and I wonder whether it can be somehow reused. But it is still a bit different, because return statements can contain simple expression as well [0]: https://github.com/sushi-shi/ReproducibleExample/blob/master/2.Ternary.sol [1]: https://github.com/sushi-shi/solang/commit/e7f1b4f0b6016e6ed4dbbdea2ad78df77400c1db [2]: https://github.com/sushi-shi/solang/blob/return/src/sema/ast.rs#L1391

ohthemboats (Sun, 26 Sep 2021 18:00:22 GMT):
@seanyoung Good day! Return statements with function calls and ternary operators returning tuples do not work[0]. Tentatively I tried to fix it myself[1], however I do want to ask what would be the best way to proceed (as codegen and possibly some other things need to be fixed as well), as of right now `Statement` for `Return` contains inside it a `Vec` of expressions[2], however it might be better to replace it with a simple expression as done in `Destructure`, also the code for return statements is structurally the same as for pattern matching tuples and I wonder whether it can be somehow reused. But it is still a bit different, because return statements can contain simple expression as well. I also wonder where should I write test cases to cover this. [0]: https://github.com/sushi-shi/ReproducibleExample/blob/master/2.Ternary.sol [1]: https://github.com/sushi-shi/solang/commit/e7f1b4f0b6016e6ed4dbbdea2ad78df77400c1db [2]: https://github.com/sushi-shi/solang/blob/return/src/sema/ast.rs#L1391

ohthemboats (Sun, 26 Sep 2021 18:00:22 GMT):
@seanyoung Good day! Return statements with function calls and ternary operators returning tuples do not work[0]. Tentatively I tried to fix it myself[1], however I do want to ask what would be the best way to proceed (as codegen and possibly some other things need to be fixed as well), as of right now `Statement` for `Return` contains inside it a `Vec` of expressions[2], however it might be better to replace it with a simple expression as done in `Destructure`, also the code for return statements is structurally the same as for pattern matching tuples and I wonder whether it can be somehow reused. But it is still a bit different, because return statements can contain a simple expression as well. I also wonder where should I write test cases to cover this. [0]: https://github.com/sushi-shi/ReproducibleExample/blob/master/2.Ternary.sol [1]: https://github.com/sushi-shi/solang/commit/e7f1b4f0b6016e6ed4dbbdea2ad78df77400c1db [2]: https://github.com/sushi-shi/solang/blob/return/src/sema/ast.rs#L1391

seanyoung (Sun, 26 Sep 2021 20:18:52 GMT):
That's very interesting, I'll have a look tomorrow morning @ohthemboats

seanyoung (Mon, 27 Sep 2021 07:32:46 GMT):
@ohthemboats interesting catch, yes this is broken. I think you're right that the ast for return should be a single expression, which can be an `Expression::List(..)` if there are mulitple values in a list. Looks like you're on the right path. If there is a way to re-use the destructure code, that would be great, if not then so be it. The best way to write a test case for this is to add some more tests to this test: https://github.com/hyperledger-labs/solang/blob/main/tests/solana_tests/simple.rs#L94-L142

seanyoung (Mon, 27 Sep 2021 07:33:07 GMT):
Your progress looks great!

ohthemboats (Mon, 27 Sep 2021 09:27:07 GMT):
Thank you! Also `return` might have no expression at all, so it also need to be wrapped in `Option`

seanyoung (Mon, 27 Sep 2021 09:42:07 GMT):
Yes, good point.

lucasste (Mon, 27 Sep 2021 12:35:07 GMT):
The algorithm of available expressions is complex. So, for 1 would be testing each function to check if it works the way we want it to. However, I defined some functions as private and they should be tested.

lucasste (Mon, 27 Sep 2021 12:35:52 GMT):
For 2, which is a nicer approach, I would create an expression, insert it in the graph and check if it is there.

ohthemboats (Tue, 28 Sep 2021 10:42:11 GMT):
@seanyoung maybe it is going to be simpler to leave everything as is, but add another `Destructure` statement right before `return`, which will deconstruct any expression return is given and pass new local variables to return instead? This way we will be able to re-use destructure code as well.

ohthemboats (Tue, 28 Sep 2021 10:42:11 GMT):
@seanyoung maybe it is going to be simpler to leave everything as is, but add another `Destructure` statement into ast, which will deconstruct any expression return is given and pass new local variables to return instead? This way we will be able to re-use destructure code as well.

seanyoung (Tue, 28 Sep 2021 10:47:39 GMT):
I guess the problem is destructure is a statement rather than an expression, so it's hard to represent this in the ast

seanyoung (Tue, 28 Sep 2021 10:48:22 GMT):
In the ast we're supposed to represent the source code structurally without any tricks. The ast is used for the language server for example.

ohthemboats (Tue, 28 Sep 2021 10:51:17 GMT):
But we already create empty constructors and some functions and add them to `Namespace`

ohthemboats (Tue, 28 Sep 2021 10:52:20 GMT):
Can't we do the same thing here? From: ``` return expr; ``` Into ``` args = expr; return args ```

ohthemboats (Tue, 28 Sep 2021 10:55:00 GMT):
It is just that right now `Return` is expected to contain only variables inside it, say here https://github.com/hyperledger-labs/solang/blob/main/src/sema/unused_variable.rs#L195

ohthemboats (Tue, 28 Sep 2021 10:55:28 GMT):
Actually, no

ohthemboats (Tue, 28 Sep 2021 10:55:28 GMT):
Sorry, not here

ohthemboats (Tue, 28 Sep 2021 10:59:33 GMT):
Okay, nvm, I think there aren't going to be any problems, possibly later in `Instr::Return`, but I haven't looked much into it so far

ohthemboats (Tue, 28 Sep 2021 11:11:34 GMT):
Still there I'm not sure exactly what is this first variable that has to be marked as used, Is it always there and hasn't been marked already? https://github.com/hyperledger-labs/solang/blob/main/src/sema/unused_variable.rs#L195

ohthemboats (Tue, 28 Sep 2021 11:11:34 GMT):
Still there I'm not sure exactly what is this first variable that has to be marked as used, Is it always there and hasn't been marked already? https://github.com/hyperledger-labs/solang/blob/main/src/sema/unused_variable.rs#L195 Can it be another function call? A ternary? Then we would need to recurse into it again

seanyoung (Tue, 28 Sep 2021 11:42:52 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=8oNJSAEH6HMewfGaE) Yes, this is not the right thing to do. In the original prototype, sema and codegen were combined into one stage. This was very hard to work with, and would not work for the language server. There are a few remnants from that still. I think `type(int).max` just expanded to a number literal in the ast, which means that the language server can't give you any information on the expression.

seanyoung (Tue, 28 Sep 2021 11:44:15 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=aq4Ly5rR6bZqaS7Zb) @lucasste what do you think?

seanyoung (Tue, 28 Sep 2021 13:33:50 GMT):
@ohthemboats @lucasste I'm not sure https://github.com/hyperledger-labs/solang/blob/main/src/sema/unused_variable.rs#L193-L198 is necessary. If a contract variable is public, it implicitly creates an accessor function. e.g.: ``` contact foo { int public a; function f() public returns (int) { return a(); } } ``` So public variable a has an accessor function. We add an accessor function to the functions for this (a bit dubious for an ast, I agree, but how else can we represent this). This code marks the return values for the accessor as used. I am pretty sure that we do not generate warnings/errors for accessor functions.

seanyoung (Tue, 28 Sep 2021 13:34:18 GMT):
If I remove those lines, then the tests still pass fine.

lucasste (Tue, 28 Sep 2021 14:26:54 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=fYbE7BvATSberpKG9) I'll take a look

lucasste (Tue, 28 Sep 2021 14:27:46 GMT):
I think I added because of a faulty test case, but I can't remember which

lucasste (Tue, 28 Sep 2021 14:27:46 GMT):
I think I added that because of a faulty test case, but I can't remember which

lucasste (Tue, 28 Sep 2021 14:27:49 GMT):
So let me check

lucasste (Tue, 28 Sep 2021 14:31:38 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=fYbE7BvATSberpKG9) That particular case happens only when the function is an assessor function. This way, we don't need to recurse into it.

lucasste (Tue, 28 Sep 2021 14:31:38 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=fYbE7BvATSberpKG9) That particular case happens only when the function is an acessor function. This way, we don't need to recurse into it.

lucasste (Tue, 28 Sep 2021 14:31:38 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=fYbE7BvATSberpKG9) That particular case happens only when the function is an accessor function. This way, we don't need to recurse into it.

lucasste (Tue, 28 Sep 2021 14:38:26 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=KQnRP6DaJcBhsuPBt) We changed the behavior of public contract variables. I remember you sent me a PR about it. This is why the code has no use anymore

lucasste (Tue, 28 Sep 2021 14:40:57 GMT):
@seanyoung https://github.com/hyperledger-labs/solang/pull/435

lucasste (Tue, 28 Sep 2021 14:42:50 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=M2q4kyhMqZdDkEMLa) @seanyoung and @ohthemboats Take a look at our discussion there. As we are always setting public variables as used, my code for making variables accessed by accessor function as used is now obsolete

lucasste (Tue, 28 Sep 2021 14:42:50 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=M2q4kyhMqZdDkEMLa) @seanyoung and @ohthemboats Take a look at our discussion there. As we are always setting public variables as used, my code for marking variables accessed by accessor function as used is now obsolete

seanyoung (Tue, 28 Sep 2021 16:31:39 GMT):
thanks @lucasste

lucasste (Tue, 28 Sep 2021 17:01:47 GMT):
Let's say we have this code: ``` a=5; b=2; if(condition) { ```

lucasste (Tue, 28 Sep 2021 17:01:47 GMT):
Let's say we have this code: ``` a=5; b=2;i if(condition) { ```

lucasste (Tue, 28 Sep 2021 17:01:47 GMT):
Let's say we have this code: ``` a=5; b=2; int f; if(condition) { f = a/b; } else { f = a/b } ```

lucasste (Tue, 28 Sep 2021 17:03:32 GMT):
I can identify that `a/b` is available after the if-else, as it appears in both blocks. I check this by look at the operands' ids (a and b) and the operation (divide)

lucasste (Tue, 28 Sep 2021 17:03:32 GMT):
I can identify that `a/b` is available after the if-else, as it appears in both blocks. I check this by looking at the operands' ids (a and b) and the operation (divide)

lucasste (Tue, 28 Sep 2021 17:06:06 GMT):
However, if I have this case: ``` if(condition) { f = a/b; g = f+5; } else { f = a/b; g =f+5; } ``` I won't be able to say that `f+5` is available after the if-else, as the operands' ids are different (f and 5 do not have the same id - the id is unique for every operation/operand inside a function).

lucasste (Tue, 28 Sep 2021 17:06:06 GMT):
However, if I have this case: ``` if(condition) { f = a/b; g = f+5; } else { f = a/b; g =f+5; } ``` I won't be able to say that `f+5` is available after the if-else, as the operands' ids are different (f and 5 do not have the same id on both branches - the id is unique for every operation/operand inside a function).

lucasste (Tue, 28 Sep 2021 17:07:45 GMT):
This is a limitation of my algorithm and I found out that is a vary hard problem to solve, so I will only be able to check that an expression, which appears on all branches, is available after them if it is composed of operands defined before the branches.

seanyoung (Tue, 28 Sep 2021 21:11:47 GMT):
That's an interesting edge case. I've given it some thought but I can't think of a solution either.

lucasste (Wed, 29 Sep 2021 23:00:47 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=ogzMw4Mc7D46HRfrR) One option would be using a hash for each operation and operand. This way, `a` and `b` would have unique hashes and the hash of `a+b` is composed of the hashes of a, b and +

lucasste (Wed, 29 Sep 2021 23:01:16 GMT):
However, hash functions might have collisions, which would render my implementation unreliable

lucasste (Thu, 30 Sep 2021 01:00:04 GMT):
@seanyoung This is a draft PR for the available expression analysis: https://github.com/hyperledger-labs/solang/pull/503

lucasste (Thu, 30 Sep 2021 01:01:22 GMT):
I have tested the code running the analysis for many inputs, including the existing examples in the tests, and it seemed to be working. I'm going to write down tests for the algorithm before marking the PR as ready for review

seanyoung (Thu, 30 Sep 2021 08:21:50 GMT):
Well a hash function may have collisions, that's why a hash data structure has collision chains. You'd be hashing/comparing large sets though (since each expression would need a hash of its parent).

seanyoung (Thu, 30 Sep 2021 08:22:27 GMT):
I would recommend writing tests as you go rather than all of them at the end. You may have forgotten some edge cases by the time you get round to writing tests.

ohthemboats (Thu, 30 Sep 2021 11:30:21 GMT):
@seanyoung Good day! There is very small pull request which fixes this. Proper instructions after casts were not generated. ``` contract c { int[] testArr; function test14() public returns (int) { int[] storage ptrArr = testArr; ptrArr.push(3); (int a, int b) = (ptrArr[0], ptrArr[0]); return a; } } ```

ohthemboats (Thu, 30 Sep 2021 11:30:23 GMT):
https://github.com/hyperledger-labs/solang/pull/504

ohthemboats (Thu, 30 Sep 2021 11:31:56 GMT):
I also think some tests are in order, should I add them to `dead_storage.sol`? It is where I found it when tried to reuse `destructure` code for function calls

seanyoung (Thu, 30 Sep 2021 11:51:44 GMT):
@ohthemboats thanks, that looks good! A testcase would be very useful. You could one here for example: https://github.com/hyperledger-labs/solang/blob/main/tests/solana_tests/destructure.rs Also hyperledger require a signed-off-by line in the commit (DCO)

seanyoung (Thu, 30 Sep 2021 11:51:55 GMT):
The signed-off-by should be your real name

seanyoung (Thu, 30 Sep 2021 11:53:03 GMT):
https://wiki.hyperledger.org/display/TSC/DCO+and+Pseudonyms

ohthemboats (Thu, 30 Sep 2021 12:18:22 GMT):
@seanyoung oh, I signed it multiple times (had to fix my email once)

ohthemboats (Thu, 30 Sep 2021 12:19:09 GMT):
immediately I don't see an option to remove previous signatures

seanyoung (Thu, 30 Sep 2021 12:44:23 GMT):
I think the only way to remove them is to edit the commit.

seanyoung (Thu, 30 Sep 2021 13:00:28 GMT):
@ohthemboats the tests failed because I've just added a `value` argument to them (for testing solana value transfers). This can be fixed by adding an extra `0` argument.

ohthemboats (Thu, 30 Sep 2021 14:30:58 GMT):
argh, I think I borked everything with fetching from upstream, I'll try to fix it now

ohthemboats (Thu, 30 Sep 2021 14:52:18 GMT):
I hope it is done! Thank you for helping out

seanyoung (Thu, 30 Sep 2021 14:56:02 GMT):
thanks, I'll merge once the ci tests pass

seanyoung (Thu, 30 Sep 2021 16:09:23 GMT):
@ohthemboats merged, thank you!

lucasste (Fri, 01 Oct 2021 00:47:12 GMT):
Cargo clippy keeps raising this error: ``` error: struct constructor field order is inconsistent with struct definition field order --> src/file_resolver.rs:154:39 | 154 | ... return Ok(ResolvedFile { | _________________________________^ 155 | | ... full_path, 156 | | ... base, 157 | | ... import_no, 158 | | ... file_no, 159 | | ... }); | |_______________________^ help: try: `ResolvedFile { full_path, file_no, import_no, base }` | = note: `-D clippy::inconsistent-struct-constructor` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inconsistent_struct_constructor ```

lucasste (Fri, 01 Oct 2021 00:47:20 GMT):
But i haven't touched this file

seanyoung (Fri, 01 Oct 2021 07:04:31 GMT):
@lucasste that's very odd. I don't see that clippy warning, and I don't think CI spots it either. I can see it if I do `cargo clippy -- -F clippy::inconsistent_struct_constructor`.

seanyoung (Fri, 01 Oct 2021 07:08:15 GMT):
Also https://rust-lang.github.io/rust-clippy/master/index.html#inconsistent_struct_constructor says the clippy is allow by default and only enabled when `cargo clippy -- -F clippy::pedantic` is run. If you run in pedantic mode, you get a ton of useless errors.

seanyoung (Fri, 01 Oct 2021 07:09:21 GMT):
aha: you message says: ``` note: `-D clippy::inconsistent-struct-constructor` implied by `-D warnings` ``` Which is not true for for rust 1.55.0, at least the one I have installed. How did you install rust? `apt-get install rust`?

seanyoung (Fri, 01 Oct 2021 07:09:21 GMT):
aha: your message says: ``` note: `-D clippy::inconsistent-struct-constructor` implied by `-D warnings` ``` Which is not true for for rust 1.55.0, at least the one I have installed via rustup. How did you install rust and what version do you have? Did you use `apt-get install rustc cargo`?

seanyoung (Fri, 01 Oct 2021 08:42:03 GMT):
btw I this clippy does make sense, so I have no problem enabling it, however it would be nice if we could figure out why this is happening for you.

ohthemboats (Fri, 01 Oct 2021 11:02:06 GMT):
Why is casting code for strings commented out here? https://github.com/hyperledger-labs/solang/blob/main/src/sema/expression.rs#L1151 This contract fails because of it ``` function g() public returns (string) { (string a, string b) = ("Hello", "World!"); return a; } ```

ohthemboats (Fri, 01 Oct 2021 11:03:15 GMT):
Because we are casting from `FunctionArg`, not from `BytesLiteral` as it is working right now for returns https://github.com/hyperledger-labs/solang/blob/main/src/sema/statements.rs#L1499

ohthemboats (Fri, 01 Oct 2021 11:18:21 GMT):
I can move all casts inside `match` arms, so that we are checking it only for function calls

ohthemboats (Fri, 01 Oct 2021 11:18:21 GMT):
I can move all casts inside `match` arms, so that we are checking it only for function calls https://github.com/hyperledger-labs/solang/blob/main/src/sema/statements.rs#L1339

lucasste (Fri, 01 Oct 2021 11:38:42 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=3ggSDv5YinhSQMsna) I think I should update my cargo. I've got version 1.53.0

seanyoung (Fri, 01 Oct 2021 15:05:14 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=2G5jG9TWy9FtEwPkh) That's interesting, yes that needs fixing

ohthemboats (Fri, 01 Oct 2021 15:05:43 GMT):
I think you can use `resolve_to` in expression for this

ohthemboats (Fri, 01 Oct 2021 15:05:43 GMT):
I think you can use `resolve_to` in expression function for this

ohthemboats (Fri, 01 Oct 2021 15:05:43 GMT):
I think I can use `resolve_to` in expression function for this

lucasste (Fri, 01 Oct 2021 15:19:17 GMT):
I've just updated cargo and now I get this error: ``` error: No suitable version of LLVM was found system-wide or pointed to by LLVM_SYS_120_PREFIX. Consider using `llvmenv` to compile an appropriate copy of LLVM, and refer to the llvm-sys documentation for more information. llvm-sys: https://crates.io/crates/llvm-sys llvmenv: https://crates.io/crates/llvmenv ```

lucasste (Fri, 01 Oct 2021 15:19:33 GMT):
Before updating, everything was working fine

lucasste (Fri, 01 Oct 2021 15:24:51 GMT):
Deleting cargo.lock and running `cargo clean` fixed the issue

ohthemboats (Fri, 01 Oct 2021 16:31:40 GMT):
@seanyoung is it the right way to use `resolve_to`? Are there any other cases which need to be covered?

ohthemboats (Fri, 01 Oct 2021 16:31:40 GMT):
@seanyoung is it the right way to use `resolve_to`? Are there any other cases which need to be covered? Say with HexLiteral

ohthemboats (Fri, 01 Oct 2021 16:31:45 GMT):
https://github.com/hyperledger-labs/solang/pull/505

seanyoung (Fri, 01 Oct 2021 17:10:07 GMT):
@ohthemboats looks fantastic, merged!

ohthemboats (Sun, 03 Oct 2021 14:54:39 GMT):
Constants from libraries do not work now. And because of it this contract fails. https://github.com/sushi-shi/solang/commit/1178144693223d99e53b13798f88266717da0696#diff-04527e56d735a456280fee9220bdd3953ab513e5b1bfe6d5a28e323c0d472ef9R8-R17 I did a preliminary commit, but I'm not sure what is the right way to transform `Variable` from `Contract` into an `Expression`. Right now I just unwrapped initializer (which seems to ad-hoc to me), and also a simple test which calls this is failing anyway). https://github.com/sushi-shi/solang/commit/1178144693223d99e53b13798f88266717da0696#diff-c6c42aa39b28e92583b71cbd0be5d302124838126cfdc74c7f21175d8b6303caR4931

ohthemboats (Sun, 03 Oct 2021 14:54:39 GMT):
Constants from libraries do not work now. And because of it this contract fails. https://github.com/sushi-shi/solang/commit/1178144693223d99e53b13798f88266717da0696#diff-04527e56d735a456280fee9220bdd3953ab513e5b1bfe6d5a28e323c0d472ef9R8-R17 I did a preliminary commit, but I'm not sure what is the right way to transform `Variable` from `Contract` into an `Expression`. Right now I just unwrapped initializer (which seems too ad-hoc to me, and also a simple test which calls this fails anyway). https://github.com/sushi-shi/solang/commit/1178144693223d99e53b13798f88266717da0696#diff-c6c42aa39b28e92583b71cbd0be5d302124838126cfdc74c7f21175d8b6303caR4931

ohthemboats (Sun, 03 Oct 2021 14:54:39 GMT):
Constants from libraries do not work now. And because of it this contract fails. https://github.com/sushi-shi/solang/commit/1178144693223d99e53b13798f88266717da0696#diff-04527e56d735a456280fee9220bdd3953ab513e5b1bfe6d5a28e323c0d472ef9R8-R17 I did a preliminary commit, but I'm not sure what is the right way to transform `Variable` from `Contract` into an `Expression`. Right now I just unwrapped initializer (which seems too ad-hoc to me). https://github.com/sushi-shi/solang/commit/1178144693223d99e53b13798f88266717da0696#diff-c6c42aa39b28e92583b71cbd0be5d302124838126cfdc74c7f21175d8b6303caR4931

seanyoung (Sun, 03 Oct 2021 17:51:42 GMT):
@ohthemboats interesting, I'll have a look tomorrow morning. I don't think you can use a const variable from a contract either (via its type).

ohthemboats (Sun, 03 Oct 2021 19:35:06 GMT):
I also don't like how indentation has grown after pattern matching deeply into the structure. As a tentative solution `loop` can be used. https://github.com/sushi-shi/solang/commit/c9d3fc16beda0329df9af151f717e40a227b920c

ohthemboats (Sun, 03 Oct 2021 19:35:06 GMT):
I also don't like how indentation has grown after pattern matching deeply into the structure. As a tentative solution `loop` can be used. (but clippy doesn't like those) https://github.com/sushi-shi/solang/commit/c9d3fc16beda0329df9af151f717e40a227b920c

ohthemboats (Sun, 03 Oct 2021 19:35:06 GMT):
I also don't like how indentation has grown after pattern matching deeply into the structure. As a tentative solution `loop` can be used. (but clippy doesn't like those) https://github.com/sushi-shi/solang/commit/d9146ac9e0498a5dc593f69ff2147c45bb16241b

ohthemboats (Sun, 03 Oct 2021 20:00:56 GMT):
For contracts an implicitly created getter needs to be called, so there shouldn't be any problems, unless I misunderstand what using via its type means. https://github.com/sushi-shi/ReproducibleExample/blob/master/UseLib.sol#L15

seanyoung (Mon, 04 Oct 2021 07:44:31 GMT):
@ohthemboats I think the code for resolving member_access should check whether it is resolving to a function or not, just like the variable code does here https://github.com/hyperledger-labs/solang/blob/main/src/sema/expression.rs#L2601-L2609

ohthemboats (Mon, 04 Oct 2021 07:55:48 GMT):
Okay! Though this will add just one more if. We still need to pattern match to get those constants

seanyoung (Mon, 04 Oct 2021 07:56:13 GMT):
Yes, this code is a getting messy.

ohthemboats (Mon, 04 Oct 2021 07:56:45 GMT):
And what about this line? https://github.com/sushi-shi/solang/commit/d9146ac9e0498a5dc593f69ff2147c45bb16241b#diff-c6c42aa39b28e92583b71cbd0be5d302124838126cfdc74c7f21175d8b6303caR4946

seanyoung (Mon, 04 Oct 2021 07:56:47 GMT):
I'm thinking of ways of making it better, but I'm coming up with much so far.

seanyoung (Mon, 04 Oct 2021 07:56:47 GMT):
I'm thinking of ways of making it better, but I'm not coming up with much so far.

ohthemboats (Mon, 04 Oct 2021 07:57:37 GMT):
We just inlined here, but I guess we need to refer to an actual constant instead

ohthemboats (Mon, 04 Oct 2021 07:58:30 GMT):
Also I'll have a look, but when we resolve to a selector call, do we still resolve to a function? Because this code is never run if it is a simple function call

seanyoung (Mon, 04 Oct 2021 07:59:06 GMT):
We can't have two constants with the same name. How can they become overloaded?

ohthemboats (Mon, 04 Oct 2021 07:59:45 GMT):
Okay, this is just unreachable

ohthemboats (Mon, 04 Oct 2021 07:59:51 GMT):
I'll fix it

seanyoung (Mon, 04 Oct 2021 08:01:41 GMT):
Rather than cloning the initializer of the constant, return `Expression::ConstantVariable(loc, Some(library_no), var_no)`. That way the language server can also tell you what the variable is (and one day we can do stuff like "go to definition").

seanyoung (Mon, 04 Oct 2021 08:02:33 GMT):
The order in which we try things may need some thinking about.

seanyoung (Mon, 04 Oct 2021 08:23:50 GMT):
Maybe it's nicer to factor this out into a function, rather than a loop with a named label. The function is getting large anywyay.

ohthemboats (Mon, 04 Oct 2021 08:25:14 GMT):
Okay!

ohthemboats (Mon, 04 Oct 2021 13:18:37 GMT):
If we were to factor it out the return type will be `Result, ()>` as we would need to distinguish between an error and a lack of constant

ohthemboats (Mon, 04 Oct 2021 13:19:16 GMT):
It feels a bit cumbersome and grepping over repository showed that such type has never been used so far

seanyoung (Mon, 04 Oct 2021 13:25:49 GMT):
Nothing wrong that return type. `fn enum_value()` and `fn resolve_using()` have exactly that return type already.

ohthemboats (Mon, 04 Oct 2021 14:19:00 GMT):
As we just pattern match into the structure the resulting type has become simply `Option` and things are now looking way better. https://github.com/hyperledger-labs/solang/pull/507

seanyoung (Mon, 04 Oct 2021 15:15:15 GMT):
Looks great @ohthemboats, merged

seanyoung (Mon, 04 Oct 2021 15:18:53 GMT):
So at the moment this not permitted: ``` contract I { int constant X = 102; } contract V { function foo() public returns (int) { return I.X; } } ``` And I'm wondering why we shouldn't make this possible. No need to have an instance of `I` to get a constant.

seanyoung (Mon, 04 Oct 2021 15:19:20 GMT):
ethereum solidity does not permit this, but that shouldn't stop us

ohthemboats (Mon, 04 Oct 2021 15:23:35 GMT):
I used solc as a standard, but all we need to do is remove this check, right? https://github.com/hyperledger-labs/solang/commit/512f73e89deb8bd8b497ca8f7c5766209a0f83ab#diff-c6c42aa39b28e92583b71cbd0be5d302124838126cfdc74c7f21175d8b6303caR5274

ohthemboats (Mon, 04 Oct 2021 15:24:05 GMT):
I also wanted to write a test ``` contract I { int constant X = 102; } contract V { function foo() public returns (int) { return I.X; } } ```

ohthemboats (Mon, 04 Oct 2021 15:24:05 GMT):
I also wanted to write a test

ohthemboats (Mon, 04 Oct 2021 15:24:26 GMT):
1 sec

ohthemboats (Mon, 04 Oct 2021 15:24:50 GMT):
.. Which will call `new` to create a new contract

ohthemboats (Mon, 04 Oct 2021 15:25:25 GMT):
But wasn't sure how to pass it dynamically as an account in tests

seanyoung (Mon, 04 Oct 2021 16:02:47 GMT):
without the check, the match is unnecessary. It could just be: ``` let (var_no, constant) = ns.contracts[library_no].variables.mut_iter()... ``` it should also check that the variable is a constant, since non-libraries can have non-constant variables.

seanyoung (Mon, 04 Oct 2021 16:03:00 GMT):
also no need to call it library_thing

ohthemboats (Mon, 04 Oct 2021 18:06:26 GMT):
Oh, of course, we also need to check whether it is a constant at all or not, right

ohthemboats (Mon, 04 Oct 2021 18:25:16 GMT):
@seanyoung we forgot this https://github.com/sushi-shi/solang/commit/70e04e284ed15fb5760807bdadd1b0e3523794a0#diff-c6c42aa39b28e92583b71cbd0be5d302124838126cfdc74c7f21175d8b6303caR5275

ohthemboats (Mon, 04 Oct 2021 18:25:33 GMT):
Can this merge be reverted?

ohthemboats (Mon, 04 Oct 2021 18:25:44 GMT):
I also added a test case for this

ohthemboats (Mon, 04 Oct 2021 18:26:49 GMT):
An error message isn't exactly the happiest one though https://github.com/sushi-shi/solang/commit/70e04e284ed15fb5760807bdadd1b0e3523794a0#diff-a68f5bf012ba38379d4c015d061faeade7f528f10a07d9f0b160bb55f92129f8R85

seanyoung (Mon, 04 Oct 2021 19:13:22 GMT):
ah of course

seanyoung (Tue, 05 Oct 2021 06:47:54 GMT):
@ohthemboats thanks for the fix that checks a contract variable is constant. Yes, you

seanyoung (Tue, 05 Oct 2021 06:47:54 GMT):
@ohthemboats thanks for the fix that checks a contract variable is constant. Yes, you're right that the error message isn't great. The way to solve this is use resolve to to check if we're really resolving to function, and if not, have an error message saying "this variable is not constant".

ohthemboats (Tue, 05 Oct 2021 07:50:30 GMT):
I thought about it, but this function is also resolving some other cases, which might also not be functions, I think, I haven't looked much there so far

ohthemboats (Tue, 05 Oct 2021 07:52:04 GMT):
With return the main idea was to reuse the same code which is used for `fn sema::expression()`. So I had to rewrite some branches of that big `match` as functions and add a tag whether we are allowed to destruct or not (which will just skip the last step, which check that functions return a singe argument)

ohthemboats (Tue, 05 Oct 2021 07:52:42 GMT):
https://github.com/hyperledger-labs/solang/pull/510/files#diff-c6c42aa39b28e92583b71cbd0be5d302124838126cfdc74c7f21175d8b6303caR1991

ohthemboats (Tue, 05 Oct 2021 07:52:49 GMT):
Like here

seanyoung (Tue, 05 Oct 2021 07:52:59 GMT):
yes, I think that totally makes sense.

ohthemboats (Tue, 05 Oct 2021 07:54:16 GMT):
Also `call_expr` marks all function arguments as used, but doesn't do the same for casts. https://github.com/hyperledger-labs/solang/pull/510/files#diff-c6c42aa39b28e92583b71cbd0be5d302124838126cfdc74c7f21175d8b6303caR7895 https://github.com/hyperledger-labs/solang/pull/510/files#diff-c6c42aa39b28e92583b71cbd0be5d302124838126cfdc74c7f21175d8b6303caR7875

ohthemboats (Tue, 05 Oct 2021 07:54:33 GMT):
I wonder whether we need to also add `used_variable` call there

ohthemboats (Tue, 05 Oct 2021 07:57:17 GMT):
I also don't like how there are two very similar paths in a `return_with_values` function. One used for everything, the second one for functions, named functions, casts and structs I'm not sure how those might be merged https://github.com/hyperledger-labs/solang/pull/510/files#diff-4a712d7a3bd2c623e9ae5bcb7bed4928ed2227fea3d57b0768921e124de66eceR1664

ohthemboats (Tue, 05 Oct 2021 07:58:59 GMT):
This also required to change `tys()` to work for all cases, as casts and structs are falling down in the case, where `tys` is used for functions. https://github.com/hyperledger-labs/solang/pull/510/files#diff-c6c42aa39b28e92583b71cbd0be5d302124838126cfdc74c7f21175d8b6303caR156

seanyoung (Tue, 05 Oct 2021 08:01:02 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=8KFG39Q7M7SNvpPpZ) If I compile: ``` contract c { function test(int arg) public pure returns (int64) { return int64(arg); } } ``` I don't get any warnings.

seanyoung (Tue, 05 Oct 2021 08:01:28 GMT):
Having said that, it's no clear how this works then

ohthemboats (Tue, 05 Oct 2021 08:01:45 GMT):
Because `used_variable` is called after in `return_with_values`

seanyoung (Tue, 05 Oct 2021 08:03:40 GMT):
How about ``` contract c { function test(int arg) public pure returns (int64) { int64 i = int64(arg); return i; } } ```

seanyoung (Tue, 05 Oct 2021 08:03:48 GMT):
that also does not generate a warning

ohthemboats (Tue, 05 Oct 2021 08:04:01 GMT):
At first I didn't do it and the similar case was haunting me with returning zero instead of 42 https://github.com/hyperledger-labs/solang/pull/510/files#diff-a7271e996ec354ff899cab9a9f198c8e8c5534066040a422f11ef0afa6833a12R24

ohthemboats (Tue, 05 Oct 2021 08:05:44 GMT):
Most likely it is done in `statement`, I'll have a look

seanyoung (Tue, 05 Oct 2021 08:06:34 GMT):
I think your "Add support for destructive expressions in return" pr looks great. Nice cleanups as well.

seanyoung (Tue, 05 Oct 2021 08:06:47 GMT):
merged

ohthemboats (Tue, 05 Oct 2021 08:07:04 GMT):
Thank you!

seanyoung (Tue, 05 Oct 2021 09:41:40 GMT):
@ohthemboats what do you think https://github.com/hyperledger-labs/solang/pull/511/commits/b770e1d64253e85f4ce69c1e2f81c83163655fa0 ?

ohthemboats (Tue, 05 Oct 2021 10:08:37 GMT):
I don't think there is a single test cases which covers `fall though` case

ohthemboats (Tue, 05 Oct 2021 10:08:37 GMT):
I don't think there is a single test cases which covers `fall through` case

ohthemboats (Tue, 05 Oct 2021 10:08:37 GMT):
I don't think there is a single test case which covers `fall through` case

ohthemboats (Tue, 05 Oct 2021 10:10:32 GMT):
Because function calls from contracts are resolved differently in `function_call_expr`

ohthemboats (Tue, 05 Oct 2021 10:12:21 GMT):
While `resolve_to` is not always points to a function, say here it is `bytes4`, and I wonder whether it can clash somehow ``` contract X { function x() public returns (bytes4) { return I.X.selector; } } interface I { function X(bytes) external; } ```

ohthemboats (Tue, 05 Oct 2021 11:09:05 GMT):
Am I doing something wrong, or why all tests in `integration/solana` fail on master

ohthemboats (Tue, 05 Oct 2021 11:09:51 GMT):
With something like ``` calling constructor [true] Transaction simulation failed: Error processing Instruction 0: Program failed to complete Program 3FnDwMmpS6h2w3JvzCM3WnHhkwu8vBJxT5HL9aYNU2xC invoke [1] Program 3FnDwMmpS6h2w3JvzCM3WnHhkwu8vBJxT5HL9aYNU2xC consumed 534 of 200000 compute units Program failed to complete: ELF error: Unresolved symbol (sol_set_return_data) at instruction #9080 (ELF file offset 0x11ad8) Program 3FnDwMmpS6h2w3JvzCM3WnHhkwu8vBJxT5HL9aYNU2xC failed: Program failed to complete ```

ohthemboats (Tue, 05 Oct 2021 11:10:41 GMT):
``` # solana --version solana-cli 1.7.14 (src:5bdb8242; feat:1824749018) ```

ohthemboats (Tue, 05 Oct 2021 11:13:20 GMT):
I'm using `solana-test-validator` ``` # solana-test-validator --version solana-test-validator 1.7.14 (src:5bdb8242; feat:1824749018) ```

ohthemboats (Tue, 05 Oct 2021 11:23:13 GMT):
I tried earlier commit[1] and the problem persists [1]: 148dc2fa0fa63bdf890c7d22f7a2774935a129ee Ensure all intermediates generated by tests are ignored

ohthemboats (Tue, 05 Oct 2021 11:23:13 GMT):
I tried earlier commits[1] and the problem persists [1]: 148dc2fa0fa63bdf890c7d22f7a2774935a129ee Ensure all intermediates generated by tests are ignored

seanyoung (Tue, 05 Oct 2021 11:26:53 GMT):
`sol_set_return_data` is a new feature in Solana. You'll need the latest solana code, either built from master or ``` podman run --rm -p 8899:8899 -p 8900:8900 solanalabs/solana:edge ```

seanyoung (Tue, 05 Oct 2021 11:27:40 GMT):
See https://solang.readthedocs.io/en/latest/targets.html

seanyoung (Tue, 05 Oct 2021 11:27:40 GMT):
See https://solang.readthedocs.io/en/latest/targets.html#solana

ohthemboats (Tue, 05 Oct 2021 11:27:46 GMT):
Thank you

seanyoung (Tue, 05 Oct 2021 11:37:55 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=NJy5ECBpsZmeap5Fr) Good point, I've removed it.

seanyoung (Tue, 05 Oct 2021 11:58:41 GMT):
I've found a test case: ``` contract c { int public selector = 102; } contract x is c { function f1() public { int a = c.selector(); } function f2() public { function() internal returns (int) a = c.selector; } } ```

seanyoung (Tue, 05 Oct 2021 11:59:22 GMT):
strangely enough ethereum solidity can't compile either f1 or f2

ohthemboats (Tue, 05 Oct 2021 12:11:02 GMT):
Maybe `selector` should be another keyword?

ohthemboats (Tue, 05 Oct 2021 12:13:10 GMT):
``` contract c { int public selector = 102; } ``` So this doesn't compile at all? Those `solc` does compile it

ohthemboats (Tue, 05 Oct 2021 12:13:10 GMT):
``` contract c { int public selector = 102; } ``` So this doesn't compile at all? Though `solc` does compile it

seanyoung (Tue, 05 Oct 2021 12:17:49 GMT):
solc doesn't compile contract x above

ohthemboats (Tue, 05 Oct 2021 18:14:11 GMT):
@seanyoung how long would it approximately take to get those features on stable?

seanyoung (Tue, 05 Oct 2021 18:14:48 GMT):
So you mean on a solang release?

ohthemboats (Tue, 05 Oct 2021 18:15:51 GMT):
Yes, and also I wonder whether can I expect that support for calling solana's contracts will be there as well

ohthemboats (Tue, 05 Oct 2021 18:15:51 GMT):
Yes, and also I wonder whether I can expect that support for calling solana's contracts will be there as well

seanyoung (Tue, 05 Oct 2021 18:16:53 GMT):
There are some last features needed for Solang on Solana like `msg.data` and value transfers. Once that is done, I'll cut a release. I suspect that will be in the next two weeks. After that calling solana's contracts will be next.

seanyoung (Tue, 05 Oct 2021 18:16:53 GMT):
There are some last features needed for Solana like `msg.data` and value transfers. Once that is done, I'll cut a release. I suspect that will be in the next two weeks. After that calling solana's contracts will be next.

seanyoung (Tue, 05 Oct 2021 18:18:29 GMT):
There is a @solana/solidity npm library in the works as well, which is nearing completion. https://github.com/solana-labs/solana-solidity.js/pull/2

ohthemboats (Tue, 05 Oct 2021 18:19:02 GMT):
So those features which are needed for calling contracts are going to be on solana's devnet by that time as well?

ohthemboats (Tue, 05 Oct 2021 18:19:24 GMT):
I mean `sol_set_return_data` etc

seanyoung (Tue, 05 Oct 2021 18:19:43 GMT):
That's a good question.

seanyoung (Tue, 05 Oct 2021 18:20:29 GMT):
Let me ask on discord

ohthemboats (Tue, 05 Oct 2021 18:20:54 GMT):
It is just that I wonder approximately how long (at least in months) it might take to also get those on mainnet as well

ohthemboats (Tue, 05 Oct 2021 18:21:04 GMT):
Okay, thank you!

seanyoung (Tue, 05 Oct 2021 18:21:18 GMT):
yeah I hope soon :)

seanyoung (Wed, 06 Oct 2021 07:16:57 GMT):
There is a vague plan for a v1.8 within weeks which will appear on testnet shortly after. mainnet will take longer, we will probably backport the features to 1.7

seanyoung (Wed, 06 Oct 2021 14:55:30 GMT):
@lucasste your available expression analysis pass is merged.

seanyoung (Thu, 07 Oct 2021 11:57:18 GMT):
@ohthemboats you might be interested in https://discord.com/channels/428295358100013066/439194979856809985/895472391361277963

seanyoung (Thu, 07 Oct 2021 11:57:36 GMT):
update on monorepo branches: * v1.6 - mostly dead. Do not backport anything to v1.6 unless there's a specific RPC/Exchange that is asking for a quick fix until they can upgrade to v1.7. Ideally fully dead early next week. * v1.7 - this is now the stable branch that goes directly to mainnet. * v1.8 - beta branch for testnet. Unusually we forked this from v1.7 instead of master, because we wanted to stabilize the cost model changes in isolation on testnet. The goal is to move mainnet to the v1.8 branch quickly, 1-2 weeks at most once testnet demonstrates it works well. Minimal changes here as well. * master - now v1.9, testnet moves to v1.9 as soon as mainnet is on v1.8 and we'll enjoy the usual full month or two of stabilization on testnet with this branch

seanyoung (Thu, 07 Oct 2021 11:57:52 GMT):
So the changes for solidity are in v1.8

ohthemboats (Thu, 07 Oct 2021 12:07:19 GMT):
``` contract Math { enum MathError { NO_ERROR } } contract IsMath is Math { struct WithMath { // Math.MathError mathSome; MathError mathSome; } } ``` This contract didn't compile before. https://github.com/hyperledger-labs/solang/pull/515

ohthemboats (Thu, 07 Oct 2021 12:07:32 GMT):
@seanyoung thank you!

seanyoung (Thu, 07 Oct 2021 12:10:05 GMT):
ah interesting. That looks right.

ohthemboats (Thu, 07 Oct 2021 12:10:18 GMT):
Oh, also, now that I look at it, I'm not sure how cycles are resolved

ohthemboats (Thu, 07 Oct 2021 12:10:18 GMT):
Oh, also, now that I'm looking at it, I'm not sure how cycles are resolved

ohthemboats (Thu, 07 Oct 2021 12:10:35 GMT):
I'll write a test for those as well

ohthemboats (Thu, 07 Oct 2021 12:16:19 GMT):
There are tests for those, the only problem is `resolve_fields` will run even if `resolve_base_contracts` is erroneous, after that we are checking that everything is fine

seanyoung (Thu, 07 Oct 2021 12:38:43 GMT):
We should resolve as much as we can, even when there are errors. Obviously the compiler shouldn't go into infinite loops or produce garbage error messages.

ohthemboats (Thu, 07 Oct 2021 13:04:15 GMT):
Then everything should be fine

ohthemboats (Thu, 07 Oct 2021 13:04:52 GMT):
As `resolve_base_contracts` will just skip cycles and write errors into diagnostics

ohthemboats (Thu, 07 Oct 2021 13:09:36 GMT):
Would it make sense to let dynamic arrays support `uint256` and not just `uint32`, just like `solc` does it? ``` function foo(uint idx) public { uint[] fools = new uint[](idx); } ```

seanyoung (Thu, 07 Oct 2021 13:10:49 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=3ZLqFgg2kuZsfuLFa) Yes, it does. That needs fixing ideally. However codegen needs to make sure that the index is in range.

seanyoung (Thu, 07 Oct 2021 13:11:22 GMT):
(as in, not just cast `uint256` to `uint32` without checking that it fits)

ohthemboats (Thu, 07 Oct 2021 13:11:59 GMT):
And when it doesn't?

seanyoung (Thu, 07 Oct 2021 13:12:22 GMT):
index out of bounds error, just like when an `uint32` index is out of bounds

seanyoung (Thu, 07 Oct 2021 13:12:58 GMT):
The index checks are inserted during codegen stage, the emit/llvm stage assumes that the index is checked.

ohthemboats (Thu, 07 Oct 2021 13:13:22 GMT):
Okay, I'll have a look and try to fix it!

seanyoung (Thu, 07 Oct 2021 13:16:23 GMT):
@ohthemboats fantastic

ohthemboats (Thu, 07 Oct 2021 14:06:24 GMT):
@seanyoung Also one more thing! Why is `blockhash` set only to work with ewasm and not solana and other targets?

seanyoung (Thu, 07 Oct 2021 14:07:43 GMT):
blockhash isn't available on substrate. For Solana, it's on my to-do list

ohthemboats (Thu, 07 Oct 2021 14:08:04 GMT):
Okay, thank you!

ohthemboats (Fri, 08 Oct 2021 22:26:52 GMT):
I'm not exactly sure what I did, as I haven't read into LLVM much, however, those two lines were working incorreclty for StorageRefs. https://github.com/hyperledger-labs/solang/pull/520

ohthemboats (Fri, 08 Oct 2021 22:26:52 GMT):
I'm not exactly sure why those two lines have to be ints, as I haven't read into LLVM and inkwell much, however, those two lines weren't working for StorageRefs. https://github.com/hyperledger-labs/solang/pull/520

ohthemboats (Fri, 08 Oct 2021 22:26:52 GMT):
I'm not exactly sure why those two exprs have to be ints, as I haven't read into LLVM and inkwell much, however, those two lines weren't working for StorageRefs. https://github.com/hyperledger-labs/solang/pull/520

ohthemboats (Fri, 08 Oct 2021 22:37:30 GMT):
And tests do not pass, for now I'm unsure what to do next

seanyoung (Sat, 09 Oct 2021 19:51:57 GMT):
@ohthemboats you're exactly right, those should have never been ints. Merged.

ohthemboats (Sun, 10 Oct 2021 18:13:50 GMT):
I'm not sure this needs to be added, but there are some contracts which fail with `/////` or `/*****/` at the top or at the bottom of the file https://github.com/hyperledger-labs/solang/pull/521/files

ohthemboats (Sun, 10 Oct 2021 18:45:35 GMT):
The other pr fails with (or maybe it is a different error) ``` solang: /home/runner/work/solang/solang/llvm-project/llvm/lib/Transforms/Utils/ValueMapper.cpp:861: void {anonymous}::Mapper::remapInstruction(llvm::Instruction*): Assertion `(Flags & RF_IgnoreMissingLocals) && "Referenced value not in value map!"' failed. ``` I'll try to fix it tomorrow https://github.com/hyperledger-labs/solang/pull/522

ohthemboats (Sun, 10 Oct 2021 18:48:23 GMT):
It is a different one

ohthemboats (Sun, 10 Oct 2021 19:02:27 GMT):
Yet related, here is a smallest test case so far ``` contract c { int foo; bool bar; function func() external mod() returns (int) { return foo; } modifier mod() { if (bar) { _; } else { _; } } } ```

seanyoung (Mon, 11 Oct 2021 07:38:24 GMT):
@ohthemboats I see you got both issues resolved, PRs are merged. Thank you!

seanyoung (Mon, 11 Oct 2021 07:42:36 GMT):
@ohthemboats I've found another issue wrt to comments towards the end of the file https://github.com/hyperledger-labs/solang/pull/523

lucasste (Mon, 11 Oct 2021 12:02:46 GMT):
Do I need to insert temporary variables into the symble table?

lucasste (Mon, 11 Oct 2021 12:03:03 GMT):
When doing common subexpression elimination

lucasste (Mon, 11 Oct 2021 12:07:16 GMT):
This new temporaries need a `var_no` and I thought I could get it from the symble table. Is there any other way to get the number?

lucasste (Mon, 11 Oct 2021 12:07:16 GMT):
These new temporaries need a `var_no` and I thought I could get it from the symble table. Is there any other way to get the number?

seanyoung (Mon, 11 Oct 2021 12:07:38 GMT):
Well the cfg has a variable table. You'll need to add entries in there. Nothing needs to be added to the ast symbol table.

seanyoung (Mon, 11 Oct 2021 12:08:46 GMT):
The namespace has an `next_id` which can be used for creating unique ids

lucasste (Mon, 11 Oct 2021 12:13:22 GMT):
There cfg's vartable is transformed into a `hashmap` and is inaccessible from the the `struct ControlFlowGraph`

lucasste (Mon, 11 Oct 2021 12:22:25 GMT):
I'm going to add the new variables directly to the hashmap

lucasste (Mon, 11 Oct 2021 12:22:25 GMT):
I'm going to add the new variables directly to the hashmap, using `next_id`

seanyoung (Mon, 11 Oct 2021 13:37:40 GMT):
I think that makes sense

seanyoung (Mon, 11 Oct 2021 14:50:34 GMT):
I've just been looking at implementing `blockhash()` on Solana. There is the https://edge.docs.solana.com/developing/runtime-facilities/sysvars#recentblockhashes which could be used for that, but it has two issues: 1. It is deprecated: https://github.com/solana-labs/solana/pull/18875 2. It does not give the block/slot of the blockhash so it would not work with the existing `blockhash()` function signature, which takes the block number. I'm not sure we should implement this on Solana - why would you want a recent block hash anyway? If you're looking for random data, ideally we should have a verifiable random function (which Solana doesn't have yet, but there certainly is demand for it).

ohthemboats (Tue, 12 Oct 2021 12:00:29 GMT):
@seanyoung `sol_log_data` doesn't seem to be in 1.8.0

ohthemboats (Tue, 12 Oct 2021 12:00:29 GMT):
@seanyoung `sol_log_data` doesn't seem to be in 1.8.0 as well

seanyoung (Tue, 12 Oct 2021 12:01:01 GMT):
yes, I discovered that too! I'm working on the backport today.

seanyoung (Tue, 12 Oct 2021 12:01:32 GMT):
None of the features we need are in 1.8.0

seanyoung (Tue, 12 Oct 2021 12:01:49 GMT):
so I'm backporting everything. needs a good test as it will go into production

ohthemboats (Tue, 12 Oct 2021 12:02:13 GMT):
I see, thank you!

seanyoung (Wed, 13 Oct 2021 13:36:54 GMT):
@ohthemboats `sol_log_data` is now in the 1.8 branch, as is the `sol_set_return_data`. https://github.com/solana-labs/solana/pull/20620 and https://github.com/solana-labs/solana/pull/20628 I still have to merge the ed25519 program for signature verification, but that's less important.

lebdron (Fri, 15 Oct 2021 16:34:03 GMT):
Has joined the channel.

lebdron (Fri, 15 Oct 2021 16:36:54 GMT):
Hi! I've been trying to run the Solana integration example locally, but I keep getting error. For example, for flipper I get `Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: invalid account data for instruction`. I am using solang 0.1.8 and Solana 1.7.3 the same as in the CI test script. I wonder if it's caused by the versions of npm packages. I am using node 14.18.1

kdahya (Sun, 17 Oct 2021 02:50:49 GMT):
Has joined the channel.

seanyoung (Mon, 18 Oct 2021 14:50:21 GMT):
I've now backported the ed25519 signature verify program to solana v1.8. This means all the relevant pieces are in the v1.8 branch, and should be included in v1.8.1.

lebdron (Mon, 18 Oct 2021 14:52:08 GMT):
@seanyoung Hi! I implemented the integration example for Solana in Golang, I wonder what would be the best way to contribute it, because I think it might be useful for Golang users. I tested it with flipper contract for now, it works fine

seanyoung (Mon, 18 Oct 2021 14:52:52 GMT):
@lebdron that's fantastic!

lebdron (Mon, 18 Oct 2021 14:54:52 GMT):
Should I create a go subdirectory in integration/solana, and just put everything there? Or I can just add go.mod and two-three go files directly in integration/solana directory

lebdron (Mon, 18 Oct 2021 14:55:15 GMT):
Or, well, I can create a PR draft and we can figure out the details there

lebdron (Mon, 18 Oct 2021 14:58:25 GMT):
I am also waiting for https://github.com/gagliardetto/solana-go/pull/9 to be merged, as this bug prevents using websockets in the SDK

seanyoung (Mon, 18 Oct 2021 15:08:04 GMT):
I am wondering if this should just go into the top-level of the solang repo, that way might be easier to use as a go module. Either that or it could be merged with https://github.com/gagliardetto/solana-go/ itself.

lebdron (Mon, 18 Oct 2021 15:11:33 GMT):
Good question. The thing is that I implemented index.ts, as I was working with v0.1.8, so it's just a couple of helper methods. Not as fancy as the new solana-solidity library :)

seanyoung (Mon, 18 Oct 2021 15:24:10 GMT):
it has to start somewhere :)

lebdron (Mon, 18 Oct 2021 15:30:34 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=LtAYsevmhwJ8raoQt) Also after thinking for a bit, I think there are problems to be solved with both approaches. If we put it in the root of solang repo, installing the go module will pull all the repo files if I am correct, and there will be files pulled which are unrelated to the library. If we try to merge it into solana-go, solana-go will start depending on go-ethereum, which is a large library too. So I wonder whether the best idea would be to replicate the approach with solana-solidity repo, now with golang

seanyoung (Mon, 18 Oct 2021 17:24:30 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=aTJmjNRtTwrs4evG9) I've spent a little time reading about go modules, and I think you're right.

seanyoung (Wed, 20 Oct 2021 17:16:39 GMT):
@lebdron is your go library available somewhere?

lebdron (Wed, 20 Oct 2021 23:34:39 GMT):
@seanyoung not yet unfortunately. I was fixing the BPF loader PR to solana-go, and I stumbled upon one question in Solana Rust implementation which I did not get answer to yet. https://github.com/solana-labs/solana/blob/master/cli/src/program.rs#L2038 here we check that `system_program::id == account.owner`, and later inside we check https://github.com/solana-labs/solana/blob/master/cli/src/program.rs#L2043 `account.owner != *loader_id`. To me it seems that the latter will always be true

seanyoung (Thu, 21 Oct 2021 09:16:02 GMT):
I'm just reading the solana cli source, I have not used it much for deployment

seanyoung (Thu, 21 Oct 2021 09:40:02 GMT):
So line 2038 is " if this program have no owner and no account data" Line 2043 is "if the owner is not the loader bpf" which is always true, I think.

seanyoung (Thu, 21 Oct 2021 09:41:23 GMT):
@lebdron I'm not sure that reading solana cli is the best route for understanding this. Understanding the solana account model is not trivial.

seanyoung (Thu, 21 Oct 2021 09:41:23 GMT):
@lebdron I'm not sure that reading solana cli is the best route for understanding this. Understanding the solana account model is not the easiest, let me know if I can help in any way

lebdron (Thu, 21 Oct 2021 09:43:23 GMT):
OK, thank you very much for going through the code too! I think I'll open an issue in their repo then, because I did not have success with their discord channels. But yes, then I'll make at least some working version of the loader, will upload the go library and send you the link!

seanyoung (Thu, 21 Oct 2021 09:43:39 GMT):
Where did you ask in discord?

seanyoung (Thu, 21 Oct 2021 09:43:56 GMT):
Looking forward to seeing it!

lebdron (Thu, 21 Oct 2021 09:45:00 GMT):
https://solana.com/community so here they have a link for discord server as for "engineering" discussions. And I tried `#developer-support` channel there

lebdron (Thu, 21 Oct 2021 09:47:57 GMT):
TBH I found it a bit hard to follow the channel there, as discord does not show replies to my message explicitly, and there are a lot of messages :D

seanyoung (Thu, 21 Oct 2021 09:48:51 GMT):
Ok. Interesting in solana is going through the roof and I hear that they are having trouble keeping on top of it.

seanyoung (Thu, 21 Oct 2021 09:49:42 GMT):
One way of doing this might be to open a PR which removes the if conditional.

seanyoung (Thu, 21 Oct 2021 09:50:10 GMT):
I should say that I am part of solana labs!

lebdron (Thu, 21 Oct 2021 09:50:34 GMT):
https://gist.github.com/lebdron/73530e3fb495eae93fd2a37a434a82e2 I can share this for now, just to show the overall structure, the `loader.Load` method will be changed not to contain network calls

lebdron (Thu, 21 Oct 2021 09:51:29 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=uBv6qTrftqkMnuW3X) Oh that's great! Then I can bug you more with the solana-related questions :grin:

seanyoung (Thu, 21 Oct 2021 09:59:12 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=kBFbF6rkyvesf9Tzu) Of course!

seanyoung (Thu, 21 Oct 2021 10:00:13 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=zHrziMgAE9AdBT84G) Looks great!

seanyoung (Thu, 21 Oct 2021 11:47:34 GMT):
Solana v1.8.1 has been released, which contains all the fixes needed for Solang. @ohthemboats

lebdron (Fri, 22 Oct 2021 08:50:16 GMT):
By the way, Sean, I wonder if you looked at dfinity, because they seem to be able to run WASM code too

seanyoung (Fri, 22 Oct 2021 09:34:47 GMT):
I had not looked at dfinity before. Looks like they maintain wasm memory state, so there is no reason to explicitly save/store contract variables. In principle this shouldn't be so hard to support, but then again there might be other gotchas.

lebdron (Fri, 22 Oct 2021 09:44:07 GMT):
Does this mean that it should theoretically be possible to reuse the code generated for substrate?

seanyoung (Fri, 22 Oct 2021 09:47:55 GMT):
Solang has code emitter which has target-specific parts. The way to do this is to add a new target, and implement those methods for the new target. Now this sounds easier than it is. However, all the parts are there. Someone should totally submit a grant proposal to https://dfinity.org/grants - I don't have the time to do this. This does require in-depth knowledge of wasm, llvm IR and dfinity of course.

seanyoung (Fri, 22 Oct 2021 09:47:55 GMT):
Solang has code emitter which has target-specific parts. The way to do this is to add a new target, and implement those methods for the new target. Now this sounds easier than it is. However, all the parts are there. Someone should totally submit a grant proposal to https://dfinity.org/grants - I don't have the time to do this. This does require in-depth knowledge of rust, wasm, llvm IR and dfinity of course.

lebdron (Fri, 22 Oct 2021 09:53:41 GMT):
Sounds like an interesting idea, I might try to investigate that route, thank you!

seanyoung (Fri, 22 Oct 2021 09:59:56 GMT):
I can help with the solang side of things.

dmimaz (Mon, 25 Oct 2021 17:46:46 GMT):
Has joined the channel.

dmimaz (Mon, 25 Oct 2021 17:46:46 GMT):
Hi, Guys! )) Please help me to understand some basics )). I'm trying to run solidity-build contract on Solana testnet 1. I've written a primitive Solidity contract // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; contract Var { string a = "SHE LIVES!!!!!"; function get() public view returns(string memory){ return a; } } 2. Built it using Solang 3. Deployed it to RPC URL: https://api.devnet.solana.com and got Program Id Question is: I can not understand how to execute that program ((

seanyoung (Mon, 25 Oct 2021 17:55:58 GMT):
So at the moment the way to do this is to write some typescript which executes it. There is a new solana-solidity.js library being written: https://github.com/solana-labs/solana-solidity.js/pull/2 and https://www.npmjs.com/package/solana-solidity Alternatively there is some typescript here which does it a bit more manual https://github.com/hyperledger-labs/solang/tree/main/integration/solana I have been thinking about writing a command line tool which can deploy and call solidity contracts. That would be super useful for testing. Lately I should note that solana v1.8.1 is required, I haven't been following testnet too closely.

seanyoung (Mon, 25 Oct 2021 17:56:05 GMT):
@dmimaz

dmimaz (Mon, 25 Oct 2021 17:57:52 GMT):
thanx a lot ! )) One more question, if you know... Will this method work with Solana forks, like Velas etc... ?

dmimaz (Mon, 25 Oct 2021 17:57:52 GMT):
thanx a lot ! )) One more question, if you know... Will this method work with Solana forks, like Velas etc... ? seanyoung

dmimaz (Mon, 25 Oct 2021 17:57:52 GMT):
thanx a lot ! )) One more question, if you know... Will this method work with Solana forks, like Velas etc... ? @seanyoung

seanyoung (Mon, 25 Oct 2021 18:00:40 GMT):
I'm not sure Velas has all the features we need (they were only introduced recently in solana v1.8.1).

dmimaz (Mon, 25 Oct 2021 18:01:03 GMT):
Ok. Thank you very much )

lucasste (Tue, 26 Oct 2021 14:42:04 GMT):
Can I create a new folder under `codegen`? It would include a new mod.rs and contain the common subexpression elimination

lucasste (Tue, 26 Oct 2021 14:42:38 GMT):
I want to split my code into several files, as it is currently divided into two, one of which contains 1700 lines

seanyoung (Tue, 26 Oct 2021 14:43:44 GMT):
@lucasste yes, of course! Currently there quite of few rust files in solang which are too large

ohthemboats (Wed, 27 Oct 2021 09:09:26 GMT):
While skimming through the code I realized that I forgot to change one branch in a `tys` function. https://github.com/hyperledger-labs/solang/pull/536

ohthemboats (Wed, 27 Oct 2021 09:12:09 GMT):
Oh, actually, no, everything was fine

seanyoung (Wed, 27 Oct 2021 09:18:22 GMT):
@ohthemboats should the pull request be closed?

ohthemboats (Wed, 27 Oct 2021 09:18:44 GMT):
tys can be simplified, so the logic isn't implemented twice

ohthemboats (Wed, 27 Oct 2021 09:19:25 GMT):
it can be merged after tests pass, I think?

seanyoung (Wed, 27 Oct 2021 09:32:17 GMT):
ah yes now I see what you mean

seanyoung (Wed, 27 Oct 2021 09:32:31 GMT):
yes, it can be merged, looks good!

seanyoung (Wed, 27 Oct 2021 10:01:00 GMT):
@ohthemboats nice catch, thank you for fixed -- merged

seanyoung (Wed, 27 Oct 2021 10:01:00 GMT):
@ohthemboats nice catch, thank you for fixing -- merged

ohthemboats (Wed, 27 Oct 2021 10:21:35 GMT):
Also when I'm encountering small things like that, should I create an additional pr for them? https://github.com/sushi-shi/solang/commit/c61cae93778d979c97501cd7fee0e847cb9cb4db

ohthemboats (Wed, 27 Oct 2021 10:21:35 GMT):
Also when I'm encountering small things like that, should I create an additional pr for them? https://github.com/hyperledger-labs/solang/pull/539

seanyoung (Wed, 27 Oct 2021 12:29:10 GMT):
Anything that improves the code is good. Merged, thank you!

lucasste (Wed, 27 Oct 2021 12:37:51 GMT):
I'm adding common subexpression elimination to `struct Options ` in `codegen/mod.rs`, so that we can disable it if necessary

seanyoung (Wed, 27 Oct 2021 12:38:49 GMT):
It's nice to be able to compare with and without an optimization pass.

lucasste (Thu, 28 Oct 2021 20:49:22 GMT):
It looks like `ns.next_id` does not contain the most up to date version of the `next_id`

lucasste (Thu, 28 Oct 2021 20:49:22 GMT):
It looks like `ns.next_id` does not contain the most up to date version of the `id`

lucasste (Thu, 28 Oct 2021 20:50:28 GMT):
It thought there was a bug in my code, but I found the `ns.next_id` was giving me a already existing `id`

lucasste (Thu, 28 Oct 2021 20:50:28 GMT):
It thought there was a bug in my code, but I found the `ns.next_id` was giving me an already existing `id`

lucasste (Thu, 28 Oct 2021 20:55:22 GMT):
The problem is that the `VarTable` saves a local copy of the `Namespace.next_id` and does not update it after using it

lucasste (Thu, 28 Oct 2021 20:55:49 GMT):
I am fetching the `next_id` directly from the `Namespace` to create my temporaries

lucasste (Thu, 28 Oct 2021 22:22:53 GMT):
Impressibely this was the only thing breaking the current codegen tests

lucasste (Thu, 28 Oct 2021 22:22:53 GMT):
Impressively this was the only thing breaking the current codegen tests

lucasste (Thu, 28 Oct 2021 22:23:37 GMT):
@seanyoung Please take a look at my PR. It fixes the `next_id` issue. https://github.com/hyperledger-labs/solang/pull/540

lucasste (Thu, 28 Oct 2021 22:24:46 GMT):
Feel free to suggest any edits.

lucasste (Thu, 28 Oct 2021 22:25:10 GMT):
Now, i'll be focusing on writing my own tests for the common subexpression elimination

seanyoung (Fri, 29 Oct 2021 06:51:28 GMT):
@lucasste looks good, thanks!

lebdron (Fri, 29 Oct 2021 08:26:23 GMT):
@seanyoung Hello! I've tried using `--standard-json` flag with solana target and version 0.1.8, and it does not seem to work as I would expect. Solang still creates files, and the json output basically contains the path to the sol file.

seanyoung (Fri, 29 Oct 2021 08:28:18 GMT):
@lebdron that sounds totally broken, let me check

seanyoung (Fri, 29 Oct 2021 08:28:42 GMT):
actually the burrow test uses `--standard-json` so it must be working somewhat :)

lebdron (Fri, 29 Oct 2021 08:29:17 GMT):
Let me try using other targets now too :thinking:

seanyoung (Fri, 29 Oct 2021 08:29:43 GMT):
Ah I don't think it has been used with non-ewasm before

lebdron (Fri, 29 Oct 2021 08:31:47 GMT):
Yes, now I see that it works fine for ewasm

lebdron (Fri, 29 Oct 2021 08:32:23 GMT):
Well, I can try to make it work with solana too in the same format

lebdron (Fri, 29 Oct 2021 08:32:32 GMT):
I'd use that feature in my current work now

seanyoung (Fri, 29 Oct 2021 08:32:45 GMT):
That would be great, thanks!

lebdron (Fri, 29 Oct 2021 08:34:20 GMT):
But are there major changes between 0.1.8 and current latest codebase? Because I would use 0.1.8 for compatibility purposes, as the generated code works fine with Solana 1.17.16 or 1.17.17

lebdron (Fri, 29 Oct 2021 08:37:24 GMT):
Or, in case the current main branch is compatible with solana stable, is the simplest way to build solang is to just run `docker build` in the root?

seanyoung (Fri, 29 Oct 2021 08:39:20 GMT):
The simplest way to build solang is with `docker build`

seanyoung (Fri, 29 Oct 2021 08:39:39 GMT):
The curent main branch has a ton of fixes solana, and more are on the way

lebdron (Fri, 29 Oct 2021 08:40:37 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=CZYnwda7WTovhsqnv) But are there any non-backward compatible changes? I remember seeing a PR into Solana for 1.8.x branch, but I did not get into the details

lebdron (Fri, 29 Oct 2021 08:41:46 GMT):
Non-backward compatible in a way that, is the current generated code compatible with 1.7.x

lebdron (Fri, 29 Oct 2021 08:42:16 GMT):
Considering that I have simple solidity code

seanyoung (Fri, 29 Oct 2021 08:43:06 GMT):
There are non-backwards compatible changes. Things you really want like being able to run read functions without paying for the transaction fees.

lebdron (Fri, 29 Oct 2021 10:42:05 GMT):
I think I will stay with solang output parsing for now, because the time is limited. I need to look more into why there is a separate conditional branch in the solang code for Solana

seanyoung (Fri, 29 Oct 2021 16:22:03 GMT):
So the problem is that solana produces a single binary so file for all contracts, rather than one binary wasm file for each contract.

Kazuya.N (Sat, 30 Oct 2021 08:00:22 GMT):
Has joined the channel.

lucasste (Sun, 31 Oct 2021 20:59:12 GMT):
I just found a bug. I was assuming that the BFS traversal would traverse the CFG in the same order the blocks are supposed to be executed.

lucasste (Sun, 31 Oct 2021 20:59:29 GMT):
However, that is not the case. I did then topological sorting

lucasste (Mon, 01 Nov 2021 12:46:03 GMT):
For the require instructions, like this example: ``` function assert_fails() public { require(true, "humpty-dumpty"); } ``` The generated cfg is: ``` block0: # entry branch block1 block1: # noassert return block2: # doassert assert-failure:(alloc string uint32 13 "humpty-dumpty") ``` How does the code reach block2?

lucasste (Mon, 01 Nov 2021 12:46:03 GMT):
For the require command, like this example: ``` function assert_fails() public { require(true, "humpty-dumpty"); } ``` The generated cfg is: ``` block0: # entry branch block1 block1: # noassert return block2: # doassert assert-failure:(alloc string uint32 13 "humpty-dumpty") ``` How does the code reach block2?

lucasste (Mon, 01 Nov 2021 12:46:21 GMT):
There is no `branch block2`

seanyoung (Mon, 01 Nov 2021 12:54:38 GMT):
`block2` is indeed unreachable, because you have `require(true, ..)`

seanyoung (Mon, 01 Nov 2021 12:55:05 GMT):
compare: ``` contract c { function assert_fails(bool x) public { require(x, "humpty-dumpty"); } } ``` cfg: ``` # function c::c::function::assert_fails__bool public:true selector:7ed1bea1 nonpayable:true # params: bool # returns: block0: # entry ty:bool %x = (arg #0) branchcond (arg #0), block1, block2 block1: # noassert # reaching: x:[0:0] return block2: # doassert # reaching: x:[0:0] assert-failure:(alloc string uint32 13 "humpty-dumpty") ```

lucasste (Tue, 02 Nov 2021 10:52:36 GMT):
When I write `for(int i=0; i<10; i++)`, the increment `i++` is generated as ``` ty:int256 %temp.8 = %i ty:int256 %i = (%temp.8 + int256 1) ``` Why do we need to save `i` to a temporary before incrementing?

lucasste (Tue, 02 Nov 2021 11:00:43 GMT):
Do variables out live a `do while` block?

seanyoung (Tue, 02 Nov 2021 11:23:20 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=2iRL3yjpHg8Pwmp5q) The codegen for `i++` saves the before value to a temporary

seanyoung (Tue, 02 Nov 2021 11:23:43 GMT):
I think if you do `++i` you don't see this

seanyoung (Tue, 02 Nov 2021 11:24:03 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=WgAjJk4cAzoRnt7SE) They shouldn't

seanyoung (Tue, 02 Nov 2021 11:24:37 GMT):
@lebdron I've fixed `--standard-json` with `--target solana`

seanyoung (Tue, 02 Nov 2021 11:24:37 GMT):
@lebdron I've fixed `--standard-json` with `--target solana` https://github.com/hyperledger-labs/solang/commit/3805af7a70348bb9783cad9fc9d35f764e32a5a2

lucasste (Tue, 02 Nov 2021 11:37:04 GMT):
``` function test6(int a, int b) public pure returns (int) { int x; x = a+b-54; int d = x*(a+b); do { int t = a-b; bool e1 = t > 3; x = x+d; bool e2 = e1; } while(x+d > 0); return x-d + (a-b); } ``` In this example `a-b` is assigned to `t` inside the `do-while`

lucasste (Tue, 02 Nov 2021 11:37:57 GMT):
``` # function foo::foo::function::test6__int256_int256 public:true selector:b2b10f1b nonpayable:true # params: int256,int256 # returns: int256 block0: # entry ty:int256 %a = (arg #0) ty:int256 %b = (arg #1) ty:int256 %x = undef ty:int256 %1.cse_temp = ((arg #0) + (arg #1)) ty:int256 %x = (%1.cse_temp - int256 54) ty:int256 %d = (%x * %1.cse_temp) branch block1 block1: # body # phis: x,t,e1 # reaching: d:[0:4], x:[1:2, 0:3], t:[1:0], a:[0:0], e1:[1:1], b:[0:1] ty:int256 %t = ((arg #0) - (arg #1)) ty:bool %e1 = (%t > int256 3) ty:int256 %x = (%x + %d) branch block2 block2: # conf # phis: x,t,e1 # reaching: b:[0:1], t:[1:0], a:[0:0], e1:[1:1], d:[0:4], x:[1:2] branchcond (%x > int256 0), block1, block3 block3: # enddowhile # phis: x,t,e1 # reaching: e1:[1:1], x:[1:2], t:[1:0], d:[0:4], a:[0:0], b:[0:1] return ((%x - %d) + %t) ``` Would this be valid? Using `t` instead of `a-b` at return?

lucasste (Tue, 02 Nov 2021 11:39:19 GMT):
`t` does not out live do-while, but in terms of intermediate code we always go through the `do-while` so `t` is defined at return.

seanyoung (Tue, 02 Nov 2021 11:47:32 GMT):
That's perfectly valid. Any variables declared in a block aren't visible outside of it. All that says is that the variable name is not accessible. If the variable declaration is moved to the other block then the variable name is accessible.

lucasste (Tue, 02 Nov 2021 11:48:28 GMT):
One edge case is this: ``` function test6(int a, int b) public pure returns (int) { int x; x = a+b-54; int d = x*(a+b); do { int t = a-b; bool e1 = t > 3; x = x+d; bool e2 = e1; } while(x+d > 0); int t=3; return x-d + (a-b); } ``` We define a new `t` after the `do-while`, but both `t`s have different variable number, so there is no error from LLVM. However, the CFG printer from Solang does differentiate the names.

lucasste (Tue, 02 Nov 2021 11:48:53 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=qzwyvmFHzR3A3dH54) Wait, but I didn't move the declaration

seanyoung (Tue, 02 Nov 2021 11:50:07 GMT):
These scoping roles are only for variable names. Assignments are fine as long as the variable name is visible.

lucasste (Tue, 02 Nov 2021 11:50:58 GMT):
What about the Solang CFG printer then?

lucasste (Tue, 02 Nov 2021 11:51:02 GMT):
Let me paste an example here

lucasste (Tue, 02 Nov 2021 11:51:25 GMT):
Take this contract: ``` function test6(int a, int b) public pure returns (int) { int x; x = a+b-54; int d = x*(a+b); do { int t = a-b; bool e1 = t > 3; x = x+d; bool e2 = e1; } while(x+d > 0); int t = 3; bool p = t < 2; return x-d + (a-b); } ```

lucasste (Tue, 02 Nov 2021 11:51:37 GMT):
There are two definitions of t

lucasste (Tue, 02 Nov 2021 11:52:00 GMT):
The printed CFG is this: ``` # function foo::foo::function::test6__int256_int256 public:true selector:b2b10f1b nonpayable:true # params: int256,int256 # returns: int256 block0: # entry ty:int256 %a = (arg #0) ty:int256 %b = (arg #1) ty:int256 %x = undef ty:int256 %1.cse_temp = ((arg #0) + (arg #1)) ty:int256 %x = (%1.cse_temp - int256 54) ty:int256 %d = (%x * %1.cse_temp) branch block1 block1: # body # phis: x,t,e1 # reaching: t:[1:0], x:[0:3, 1:2], a:[0:0], b:[0:1], e1:[1:1], d:[0:4] ty:int256 %t = ((arg #0) - (arg #1)) ty:bool %e1 = (%t > int256 3) ty:int256 %x = (%x + %d) branch block2 block2: # conf # phis: x,t,e1 # reaching: b:[0:1], e1:[1:1], d:[0:4], t:[1:0], a:[0:0], x:[1:2] branchcond (%x > int256 0), block1, block3 block3: # enddowhile # phis: x,t,e1 # reaching: t:[1:0], b:[0:1], e1:[1:1], x:[1:2], d:[0:4], a:[0:0] ty:int256 %t = int256 3 return ((%x - %d) + %t) ```

seanyoung (Tue, 02 Nov 2021 11:52:03 GMT):
And you can't see the difference with the cfg printer between the twots

seanyoung (Tue, 02 Nov 2021 11:52:26 GMT):
That really needs a fix.

lucasste (Tue, 02 Nov 2021 11:52:27 GMT):
At `return` `%t` refers to `a-b` not `3`

lucasste (Tue, 02 Nov 2021 11:53:08 GMT):
But both `t` have different variable numbers, so from the compiler side they are not the same

lucasste (Tue, 02 Nov 2021 11:57:41 GMT):
``` function test(int a) public pure returns (int) { int b=5; if(a +b < 5) { int c=a*6; bool e = c < 5; } return b-a; } ``` Reaching definitions says that `c` is available at `return`, even though it shouldn't be accessible. Is this right?

seanyoung (Tue, 02 Nov 2021 12:01:58 GMT):
The scoping rules are only important for sema. Once it is converted into a cfg scopes don't matter. There is no problem with `c` being available at the return block in cfg, since the variable really available , however if the solidity source code would try to use it, then that would not be permitted. It's just a silly language syntax thing.

seanyoung (Tue, 02 Nov 2021 12:01:58 GMT):
The scoping rules are only important for sema. Once it is converted into a cfg scopes don't matter. There is no problem with `c` being available at the return block in cfg, since the variable really is available , however if the solidity source code would try to use it, then that would not be permitted. It's just a silly language syntax thing.

lucasste (Tue, 02 Nov 2021 12:07:39 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=BnWvgY6DmjP77TuuD) Do have any suggestion on how variables should be shown?

seanyoung (Tue, 02 Nov 2021 12:08:05 GMT):
I'm just writing a fix for this. I think we can fix up variable names during cfg construction

lucasste (Tue, 02 Nov 2021 12:08:31 GMT):
I was going to fix this :)

lucasste (Tue, 02 Nov 2021 12:08:36 GMT):
But no problem then

seanyoung (Tue, 02 Nov 2021 12:10:27 GMT):
So here https://github.com/hyperledger-labs/solang/blob/main/src/codegen/cfg.rs#L1636-L1699 we should check for duplicate names.

seanyoung (Tue, 02 Nov 2021 12:10:48 GMT):
I was not sure how we should make variables unique though

seanyoung (Tue, 02 Nov 2021 12:11:29 GMT):
we could add `'` since this is not allowed in solidity anyway

lucasste (Tue, 02 Nov 2021 12:12:18 GMT):
We could mingle the name with the `var_no`, as the latter is unique

seanyoung (Tue, 02 Nov 2021 12:24:37 GMT):
What do you think? https://github.com/hyperledger-labs/solang/pull/545

seanyoung (Tue, 02 Nov 2021 12:38:06 GMT):
I've just updated that PR

lucasste (Tue, 02 Nov 2021 12:42:08 GMT):
I'm creating my temporaries here: https://github.com/LucasSte/solang/blob/4f4ca198f721318200d51e4413a6520c637e97a5/src/codegen/subexpression_elimination/common_subexpression_tracker.rs#L49

lucasste (Tue, 02 Nov 2021 12:42:25 GMT):
How would I create them after your PR?

lucasste (Tue, 02 Nov 2021 12:44:09 GMT):
Does it suffices to only call `Vartable::makeUnique` for the ID?

lucasste (Tue, 02 Nov 2021 12:45:38 GMT):
I also use the `pos` as the number to reference in `Expression::Variable`. It seems a little confusing that the `struct Variable` doesn't have a number anymore.

lucasste (Tue, 02 Nov 2021 12:46:28 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=k6qiff8zhkq69KKXJ) Oh, but the `pos` is now the vector index

lucasste (Tue, 02 Nov 2021 12:48:32 GMT):
I think it solves the issue

seanyoung (Tue, 02 Nov 2021 13:02:42 GMT):
The vector index was always the `pos`, however it was duplicated in the variable struct as well. This just removes the duplication.

seanyoung (Tue, 02 Nov 2021 13:03:24 GMT):
@lucasste is it ok to merge? I don't want to create difficult merge conflicts for you

lucasste (Tue, 02 Nov 2021 13:06:57 GMT):
No problems

lucasste (Tue, 02 Nov 2021 13:08:22 GMT):
Normally, we kill a definition after a variable has been redefined. But this creates a problem: ``` int p = x+d; while(x + d < 0) { x = x+d; } ``` I've got to kill `x` before `x = x+d`, otherwise it will become `x=p`

lucasste (Tue, 02 Nov 2021 14:21:01 GMT):
What is a `RationalNumberLiteral`?

lucasste (Tue, 02 Nov 2021 14:21:18 GMT):
I think this is new, because I haven't processes this case in my analysis

lucasste (Tue, 02 Nov 2021 14:21:18 GMT):
I think this is new, because I haven't processed this case in my analysis

seanyoung (Tue, 02 Nov 2021 14:23:41 GMT):
They should not occur in a cfg. Solidity has half-baked rationals. You can do stuff like: ``` uint x = 1.5 + 3.5; ``` but this this will give a compiler error: ``` uint x = 1.1; ``` So constant rationals can be used, but there is no runtime rational. During codegen all rationals are converted to integers. Sema will check they are convertable.

seanyoung (Tue, 02 Nov 2021 14:24:55 GMT):
I have no idea why this was added to the language. I think it's a bit ugly to be honest.

lucasste (Tue, 02 Nov 2021 15:09:52 GMT):
`p2 - x + a + b` has the following AST `(((p2-x)+a)+b)`. If `a+b` is available, I cannot identify that it appears int `p2 - x + a + b` because `(a+b)` is not in the AST for the former.

lucasste (Tue, 02 Nov 2021 15:09:52 GMT):
`p2 - x + a + b` has the following AST `(((p2-x)+a)+b)`. If `a+b` is available, I cannot identify that it appears in `p2 - x + a + b` because `(a+b)` is not in the AST for the former.

lucasste (Tue, 02 Nov 2021 15:10:15 GMT):
I'm trying to figure if there is a way around this

lucasste (Tue, 02 Nov 2021 15:10:15 GMT):
I'm trying to figure out if there is a way around this

seanyoung (Tue, 02 Nov 2021 16:23:35 GMT):
That's an interesting problem. I was wondering if the `Expression::Add()` node could have 3 or more children, so the tree is simpler. Not sure how much that would help.

lucasste (Tue, 02 Nov 2021 17:02:31 GMT):
Let's say we have `Add(e1, e2)` and `e2=Add(e3, e4)`, I can check whether `e1` or `e2` is also an `Add`. If so, I check if `Add(e1, e3)` are available `Add(e1,e4)` . The same reasoning may work for `Multiply` and `Divide`, however I wonder if it is worth the job

lucasste (Tue, 02 Nov 2021 17:02:31 GMT):
Let's say we have `Add(e1, e2)` and `e2=Add(e3, e4)`, I can check whether `e1` or `e2` are also an `Add`. If so, I check if `Add(e1, e3)` is available `Add(e1,e4)` . The same reasoning may work for `Multiply` and `Divide`, however I wonder if it is worth the job

seanyoung (Tue, 02 Nov 2021 17:55:59 GMT):
What I mean is we had `Add(e1, e2, e3)` would that make it easier?

seanyoung (Tue, 02 Nov 2021 17:55:59 GMT):
What I mean is if we had `Add(e1, e2, e3)` would that make it easier?

lucasste (Tue, 02 Nov 2021 18:51:25 GMT):
`Add(e1, e2, e2)` has pretty much the same effect, however it is not a binary expression anymore, so I would need to make more adaptations.

lucasste (Tue, 02 Nov 2021 18:53:15 GMT):
The problem could be reversed as well. I could have saved `(((p2-x)+a)+b)` on my graph and could be looking for `a+b`

lucasste (Tue, 02 Nov 2021 18:59:35 GMT):
The problem is that there are six permutation of `(e1, e2, e3)` I could try

lucasste (Tue, 02 Nov 2021 18:59:35 GMT):
The problem is that there are six permutations of `(e1, e2, e3)` I could check for availability

lucasste (Tue, 02 Nov 2021 19:00:14 GMT):
in `Add(e1, e2, e3)`. Even if we use a `Add(Vec)`, I would have to check for all the permutations

lucasste (Tue, 02 Nov 2021 19:00:14 GMT):
Even if we use a `Add(Vec)`, I would have to check for all the permutations

lucasste (Tue, 02 Nov 2021 19:00:21 GMT):
I don't that is worth it

lucasste (Tue, 02 Nov 2021 19:00:21 GMT):
I don't think that is worth it

lucasste (Tue, 02 Nov 2021 19:03:59 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=BRKmBTB5hBdtp5txY) Another thing worth mentioning is that I can have a `((p2-x)+a)-c` in a following instruction, raising the question: Is it worth changing `(((p2-x)+a)+b)` to `((p2-x)+(a+b))` if we later need `((p2-x)+a)`?

lucasste (Tue, 02 Nov 2021 19:03:59 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=BRKmBTB5hBdtp5txY) Another thing worth mentioning is that I can have a `((p2-x)+a)-c)` in a following instruction, raising the question: Is it worth changing `(((p2-x)+a)+b)` to `((p2-x)+(a+b))` if we later need `((p2-x)+a)`?

seanyoung (Wed, 03 Nov 2021 11:28:42 GMT):
@lucasste you are right, the cfg is generated in a terrible order, not good for reading or walking it.

seanyoung (Wed, 03 Nov 2021 13:07:30 GMT):
@here solang release v0.1.9 is out: https://github.com/hyperledger-labs/solang/releases/tag/v0.1.9 This includes a huge amount of updates for Solana and better solidity compatibility.

lucasste (Wed, 03 Nov 2021 13:38:36 GMT):
Why is it a "Lisbon Release"?

lucasste (Wed, 03 Nov 2021 13:38:44 GMT):
Anything to do with the city?

lucasste (Wed, 03 Nov 2021 13:40:02 GMT):
@seanyoung I think that your text for the releases are not correctly set up in mardown, because the links do not appear

lucasste (Wed, 03 Nov 2021 13:40:42 GMT):
Compare with this one: https://github.com/protocolbuffers/protobuf/releases/tag/v3.19.1

seanyoung (Wed, 03 Nov 2021 14:12:05 GMT):
I'll be presenting at the Solana conference in Lisbon: https://solana.com/breakpoint

seanyoung (Wed, 03 Nov 2021 14:12:27 GMT):
https://conference.solana.com/agenda/speakers/1318581

seanyoung (Wed, 03 Nov 2021 14:16:37 GMT):
You're right markdown isn't being procesed correctly. The text from the release comes from the tagged commit https://github.com/hyperledger-labs/solang/commit/7c05cb11fcf86de7e5e783a8d4785059de467782 . I think github assumes that the commit messages don't contain markdown.

lucasste (Wed, 03 Nov 2021 16:48:05 GMT):
Cool. Are you traveling to Lisbon?

lucasste (Wed, 03 Nov 2021 16:48:23 GMT):
Perhaps you could learn some Portuguese :D

lucasste (Wed, 03 Nov 2021 16:57:15 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=4TiJfe5CKaAKguacm) This name reminds me of "Lisbon revisited", which is a famous modernist poem.

seanyoung (Wed, 03 Nov 2021 18:09:29 GMT):
Yes, I'm travelling to Lisbon on Saturday. So far, I only know obrigado.

seanyoung (Wed, 03 Nov 2021 18:12:27 GMT):
I actually thought about calling it Lusitania, after the name of the roman province where Portugal is today. But people might think it means the ocean liner which was sank during the first world war.

seanyoung (Wed, 03 Nov 2021 18:12:52 GMT):
I like reading about roman history :)

seanyoung (Wed, 03 Nov 2021 18:13:53 GMT):
Solang needs better release names and a good logo. I'm not really any good at those

lucasste (Wed, 03 Nov 2021 21:17:13 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=RE9kCM4Wv4HLqCQgT) "lusitano" is an adjective in Portuguese, which means "something that comes from Portugal".

seanyoung (Thu, 04 Nov 2021 09:11:27 GMT):
That's a good fact, interesting!

seanyoung (Thu, 04 Nov 2021 09:12:20 GMT):
@lucasste I've created https://github.com/hyperledger-labs/solang/issues/549 to fix the issue of the cfg block order. I'm a bit busy preparing for Lisbon, so I won't get round to it this/next week.

minsecprisoner (Thu, 04 Nov 2021 09:55:29 GMT):
Has joined the channel.

minsecprisoner (Thu, 04 Nov 2021 10:08:52 GMT):
Hi guys, I'm looking into using Solang for a Solana-based project, but there are a couple of things that are unclear to me: 1. Is transferring tokens created with the SPL Token program between associated accounts supported? e.g. The contract owner has an account with an SPL token listed in the registry https://github.com/gnoose/token-list-1/blob/main/solana.tokenlist.json and sends token to a user's wallet when specific conditions are met. 2. If the answer is no, is there a plan to support this in the future?

seanyoung (Thu, 04 Nov 2021 11:01:13 GMT):
@minsecprisoner this is not implemented yet. Yes, this something which is very much needed. This is the next thing we will be working on. I am not sure how much work this will be yet, but this is super important.

minsecprisoner (Thu, 04 Nov 2021 11:53:33 GMT):
Sad to hear that, but also makes me optimistic for the future, since you guys have done a tremendous job so far. Thank you and hoping for more great things to come.

seanyoung (Fri, 05 Nov 2021 10:16:18 GMT):
@lucasste as you discovered the variables in the cfg are not deterministic. I've written a fix for this https://github.com/hyperledger-labs/solang/pull/552

lucasste (Fri, 05 Nov 2021 15:43:51 GMT):
Cool, so you adopted the IndexMap

seanyoung (Fri, 05 Nov 2021 17:05:18 GMT):
yep

lucasste (Sat, 06 Nov 2021 16:57:58 GMT):
@seanyoung This function: ``` function test10(int a, int b) public returns (int) { string ast = "Hello!"; string bst = "from Solang"; while (ast == bst) { ast = ast + "a"; } return a+b; } ```

lucasste (Sat, 06 Nov 2021 16:58:07 GMT):
Causes an error in LLVM:

lucasste (Sat, 06 Nov 2021 16:58:27 GMT):
``` solang: /home/lucas/Downloads/llvm-project/llvm/include/llvm/IR/Instructions.h:2681: void llvm::PHINode::setIncomingValue(unsigned int, llvm::Value*): Assertion `getType() == V->getType() && "All operands to PHI node must be the same type as the PHI node!"' failed. ```

seanyoung (Sat, 06 Nov 2021 18:35:45 GMT):
@lucasste yes, that's totally broken. I don't have time to look at it right now, hopefully tomorrow

lucasste (Sat, 06 Nov 2021 19:45:30 GMT):
Is the CFG the same for each target I choose? Will building for solana instead of substrate change the CFG?

lucasste (Sat, 06 Nov 2021 22:38:52 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=tbAqQJczC43fgvo6Z) Take a look there, because this is making my tests fail. Actually the function I pasted here is my tests for string compare and string concatenate.

lucasste (Sat, 06 Nov 2021 22:38:52 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=tbAqQJczC43fgvo6Z) Take a look at this issue, because it is making my tests fail. Actually the function I pasted here is my test for string compare and string concatenate.

lucasste (Sat, 06 Nov 2021 22:38:52 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=tbAqQJczC43fgvo6Z) Take a look at this issue, because it is making my tests fail. Actually the function I pasted here is one of my tests for string compare and string concatenate.

seanyoung (Sun, 07 Nov 2021 11:07:13 GMT):
codegen is slightly different for different targets, so the cfg will be different. There are slight differences around storage and calls to external contracts.

seanyoung (Mon, 08 Nov 2021 09:23:48 GMT):
The problem is the vector to slice pass. If I run with `--no-vector-to-slice` then the contract compiles fine. The issue is that the pass thinks both `ast` and `"a"` can be reduced to constant slices, because both values are constant. This would work if the block was an `if` statement, because it is a `while` statement it falls apart.

lucasste (Mon, 08 Nov 2021 12:04:03 GMT):
Should I modify my test then?

lucasste (Tue, 09 Nov 2021 00:54:45 GMT):
I found another bug: ``` function test12(int a, int b) public returns (int) { string c = "Hello"; bytes b1 = bytes(c); for(int p=0; p

seanyoung (Tue, 09 Nov 2021 08:00:41 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=vb7Dvbgm2Qeg9WKNS) I'm at the solana conference today, I don't have time to fix it unfortunately.

seanyoung (Tue, 09 Nov 2021 08:01:19 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=jT7nB3fh2cNaNXytK) This is due to missing `realloc` on Solana, since it uses a simple heap with no realloc

seanyoung (Tue, 09 Nov 2021 08:01:39 GMT):
I think push/pop on memory arrays should be disallowed on solana for now

lucasste (Wed, 10 Nov 2021 13:47:35 GMT):
I've finshed all test cases for my PR. I'll double check if I have not missed anything tonight and mark it as ready for review.

lucasste (Wed, 10 Nov 2021 13:47:59 GMT):
Windows tests are failing again: ```thread 'main' has overflowed its stack```

lucasste (Wed, 10 Nov 2021 13:47:59 GMT):
Windows tests are failing again on my PR: ```thread 'main' has overflowed its stack```

lucasste (Thu, 11 Nov 2021 00:17:43 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=WNhfq7T7sCuZjEQY8) Done

seanyoung (Thu, 11 Nov 2021 10:40:56 GMT):
On Windows, the stack is much smaller. It is 1MB and on linux it is 8MB

seanyoung (Thu, 11 Nov 2021 10:43:15 GMT):
You can simulate a smaller stack on linux using `limit -s 1024`

seanyoung (Thu, 11 Nov 2021 10:43:15 GMT):
You can simulate a smaller stack on linux using `ulimit -s 1024`

lucasste (Thu, 11 Nov 2021 11:31:43 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=QFz242Y8RHrmNjJfa) It is also an issue with testing in debug mode. How did you fix the issue last time?

lucasste (Thu, 11 Nov 2021 11:32:01 GMT):
When I compile with `cargo build --release`, there is no problem with the stack

seanyoung (Thu, 11 Nov 2021 11:44:54 GMT):
I'm trying to recall how I did this. Basically you can figure out how much stack space each function uses, and then you fix the worst offenders

seanyoung (Thu, 11 Nov 2021 11:45:13 GMT):
I should keep better notes

ohthemboats (Thu, 11 Nov 2021 12:58:38 GMT):
@seanyoung Good day! Finite structs were resolved as infinite ones in some cases. Also that function had `file_no` parameter for no apparent reason. https://github.com/hyperledger-labs/solang/pull/556/files

seanyoung (Thu, 11 Nov 2021 13:14:19 GMT):
@ohthemboats great, I'll have a look soon

seanyoung (Thu, 11 Nov 2021 13:17:47 GMT):
@lucasste this is the problem with stacks in debug mode on rust. Every local variable in a function takes up stack space, even if their life-times do not overlap at all. This means that large functions have a large stack size. The only way I know of getting the stack size is like so: ``` $ cargo rustc --lib -- --emit asm ``` Then open file `target/debug/deps/solang-*.s` and look for `subq $constant, $rsp`. After a bit of sorting the worst offender is codegen::expression::expression (90 kb)

lucasste (Thu, 11 Nov 2021 13:22:28 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=ptQEdZmHY8JAjY6d7) How did you find that by just looking at an assembly file?

seanyoung (Thu, 11 Nov 2021 13:24:53 GMT):
I did: ``` grep %rsp$ target/debug/deps/solang-*.s ```

seanyoung (Thu, 11 Nov 2021 13:25:44 GMT):
I think codegen expression should be refactored into smaller functions. Looks like vscode now has a "extract into function" refactor function! Should not be hard. I'll give it a go.

ohthemboats (Thu, 11 Nov 2021 13:45:10 GMT):
There are also two other issues I found recently, I might want to look into them later myself. https://github.com/hyperledger-labs/solang/issues/558 https://github.com/hyperledger-labs/solang/issues/557

lebdron (Thu, 11 Nov 2021 14:52:02 GMT):
@seanyoung Good day! Do you know by change if there is any documentation on how to run a cluster of solana nodes? To replicate a more or less the real environment

seanyoung (Thu, 11 Nov 2021 18:15:25 GMT):
@lucasste I was wrong about the stack overflow issue. The strength reduce pass is failing for you. You can fix your test with `--no-strength-reduce` while I figure out what is going on.

ohthemboats (Thu, 11 Nov 2021 19:39:03 GMT):
Regarding https://github.com/hyperledger-labs/solang/issues/559 I'm not sure why `array_push` is called on `Target::Solana` here. https://github.com/hyperledger-labs/solang/blob/main/src/codegen/expression.rs#L757 Because as the comment says it is used for dynamic bytes, not arrays.

ohthemboats (Thu, 11 Nov 2021 19:39:03 GMT):
Regarding https://github.com/hyperledger-labs/solang/issues/559 I'm not sure why `array_push` is called on `Target::Solana` here. https://github.com/hyperledger-labs/solang/blob/main/src/codegen/expression.rs#L757 Because as the comment says it is used for dynamic bytes, not arrays.

lucasste (Thu, 11 Nov 2021 20:56:40 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=MW4BKvzZSSFAeJiQu) There is a test comment out on my PR because of this issue. As soon as you fix it, please let me know

lucasste (Thu, 11 Nov 2021 20:56:40 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=MW4BKvzZSSFAeJiQu) There is a test commented out on my PR because of this issue. As soon as you fix it, please let me know

lucasste (Thu, 11 Nov 2021 21:03:21 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=DBh4QoEljyywY4fCh) It worked thanks. I'll write the docs and fix the issues you mentioned later today.

seanyoung (Fri, 12 Nov 2021 09:43:51 GMT):
@lucasste I'm reviewing your PR, looks very nice. Why is there a test commented out https://github.com/hyperledger-labs/solang/pull/550/files#diff-2cfe899cff6230a380c87d84457a44b8fdc01bd48647f1bfad9c1b6670240451R285 ?

seanyoung (Fri, 12 Nov 2021 09:43:51 GMT):
@lucasste I'm reviewing your PR, looks very nice.

seanyoung (Fri, 12 Nov 2021 10:46:22 GMT):
@lucasste merged

ohthemboats (Fri, 12 Nov 2021 15:13:08 GMT):
@seanyoung sorry for reasking the same question again, but why on Solana `storage_slots_array_push` is never called for arrays? https://github.com/hyperledger-labs/solang/blob/main/src/codegen/expression.rs#L757 And what would be the best way to proceed here? Rewrite the logic for Solana in the same way in `array_push`? Call `storage_slots_array_push` for Solana as well, but change logic inside?

ohthemboats (Fri, 12 Nov 2021 15:13:08 GMT):
@seanyoung sorry for reasking the same question again, but why on Solana `storage_slots_array_push` is never called for arrays? https://github.com/hyperledger-labs/solang/blob/main/src/codegen/expression.rs#L757 And what would be the best way to proceed here? Rewrite the logic for Solana in the same way in `array_push`? Call `storage_slots_array_push` for Solana as well, but change logic inside? So this issue could be resolved https://github.com/hyperledger-labs/solang/issues/559

seanyoung (Fri, 12 Nov 2021 16:45:59 GMT):
@ohthemboats sorry I've been catching up after the solana conference. So, the ewasm and substrate target have key-value (or slot-based) based storage, where the key is a 256 bit value. This means that for a dynamic array in storage the following is done: - One storage slot is used for storing the length of the array - The actual data is stored from keccak256 hash of the storage slot where the length is stored, data is stored from this slot onwards So there is special codegen for "slot-based" dynamic storage, like calculating the keccak256 hash for the array data slot and updating the length slot. Solana does not have anything like this. In Solana, the codegen stage simply emits a `Instr::PushStorage` instruction. This

seanyoung (Fri, 12 Nov 2021 16:45:59 GMT):
@ohthemboats sorry I've been catching up after the solana conference. So, the ewasm and substrate target have key-value (or slot-based) based storage, where the key is a 256 bit value. This means that for a dynamic array in storage the following is done: - One storage slot is used for storing the length of the array - The actual data is stored from keccak256 hash of the storage slot where the length is stored, data is stored from this slot onwards So there is special codegen for "slot-based" dynamic storage, like calculating the keccak256 hash for the array data slot and updating the length slot. Solana does not have anything like this. For `bytes` type there a special `Instr::PushStorage` and `Instr::PopStorage` on ewasm and substrate. This operates on a single storage slot, so there is no special handling in the codegen stage. This is reused for Solana. However it looks like there is an issue there.

seanyoung (Fri, 12 Nov 2021 16:49:01 GMT):
So this could definitely use a comment explaining this; the comment above the definition of `PushStorage` is totally wrong: https://github.com/hyperledger-labs/solang/blob/main/src/codegen/cfg.rs#L76

seanyoung (Sat, 13 Nov 2021 16:07:24 GMT):
@lucasste in this commit you link to the same location twice https://github.com/hyperledger-labs/solang/pull/560#issuecomment-967294935

seanyoung (Sat, 13 Nov 2021 16:07:24 GMT):
@lucasste in this comment you link to the same location twice https://github.com/hyperledger-labs/solang/pull/560#issuecomment-967294935

lebdron (Sat, 13 Nov 2021 16:35:45 GMT):
@seanyoung I solved this issue, but in general it's interesting that the scripts suggest to benchmark the network in such a way. Both multinode demo and net scripts don't distribute stake evenly by default, which affects the results as I understand

lucasste (Sat, 13 Nov 2021 20:39:28 GMT):
My mistake

lucasste (Sat, 13 Nov 2021 20:40:23 GMT):
I was trying to figure out how to make Github show that nice box containing the code, and I may have copied the same line twice.

lucasste (Sat, 13 Nov 2021 20:41:38 GMT):
It should have been line 46 and 71

lucasste (Sat, 13 Nov 2021 20:41:49 GMT):
I update the comment for the record

lucasste (Sat, 13 Nov 2021 20:41:49 GMT):
I updated the comment for the record

seanyoung (Sat, 13 Nov 2021 22:59:13 GMT):
perfect, thanks. Now I understand what you meant

lucasste (Sun, 14 Nov 2021 12:57:40 GMT):
I've just found that the sections I added to Solang docs became sub-sections of Vector to Slice Pass.

lucasste (Sun, 14 Nov 2021 12:57:46 GMT):
This PR fix this

lucasste (Sun, 14 Nov 2021 12:57:47 GMT):
https://github.com/hyperledger-labs/solang/pull/565

seanyoung (Sun, 14 Nov 2021 15:04:53 GMT):
@lucasste merged, thanks!

seanyoung (Sun, 14 Nov 2021 15:05:01 GMT):
docs are rebuilding

seanyoung (Mon, 15 Nov 2021 15:00:00 GMT):
@lucasste good luck with presenting your Hyperledger mentorship results!

lucasste (Mon, 15 Nov 2021 15:05:34 GMT):
Thanks

lucasste (Mon, 15 Nov 2021 16:02:23 GMT):
I should have said that I made a bonus contribution to Solang

lucasste (Mon, 15 Nov 2021 16:02:34 GMT):
I prettified the warnings :D

seanyoung (Mon, 15 Nov 2021 16:03:00 GMT):
Your presentation was very concise, and also very clear. Very good.

seanyoung (Wed, 17 Nov 2021 17:59:42 GMT):
@lucasste I've fixed the issue with invalid phi nodes being created: https://github.com/hyperledger-labs/solang/pull/569

lucasste (Thu, 18 Nov 2021 11:25:07 GMT):
Thanks for updating my CSE tests as well

seanyoung (Thu, 18 Nov 2021 11:37:42 GMT):
no problem, your test was totally correct, just commented out. Very nice :)

seanyoung (Fri, 19 Nov 2021 10:44:02 GMT):
solang now uses llvm 13.0 https://github.com/hyperledger-labs/solang/pull/571

lonis (Sat, 20 Nov 2021 18:09:35 GMT):
Has joined the channel.

lonis (Sat, 20 Nov 2021 18:09:35 GMT):
hey all! big thanks for the great work on the solang compiler, really made it easier for me as a solidity dev to try and experiment in the solana ecosystem

lonis (Sat, 20 Nov 2021 18:11:32 GMT):
i have a question regarding that for some reason i fail to build the docker image. Specifically, cargo build fails (it's been stuck now for around 2h) and i've restarted several times

lonis (Sat, 20 Nov 2021 18:11:40 GMT):

Clipboard - November 20, 2021 6:11 PM

lonis (Sat, 20 Nov 2021 18:12:35 GMT):

Screenshot 2021-11-20 at 18.12.29.png

lonis (Sat, 20 Nov 2021 18:12:39 GMT):
I'm also not able to join the discord channel since my username was lonis.sol which for some reason got me kicked out:)

lonis (Sat, 20 Nov 2021 18:12:55 GMT):

Screenshot 2021-11-20 at 18.12.51.png

seanyoung (Sun, 21 Nov 2021 09:44:18 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=CSuRSKGkBM79LXJNN) Solana discord struggles with a lot of scammers, who pretend to be some sort of official Solana Labs/Foundation user and then do a solana token give-away or something like that (for every 1 sol you send us, we send you 10 sol or other scams). Unfortunately this means you can't have sol in your username

seanyoung (Sun, 21 Nov 2021 09:48:51 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=co9kiWJjZKayA2p6T) This is super weird. This Dockerfile is built on github actions CI for every pull/push request, works fine there. It might be a good idea to delete all your cached containers/images and try again (not sure if this will help). I noticed your hostname ends with MBP - is this a macbook pro and is this an M1 or M1 Pro/Max?

lonis (Sun, 21 Nov 2021 11:13:18 GMT):

Screenshot 2021-11-21 at 11.13.10.png

lonis (Sun, 21 Nov 2021 11:13:38 GMT):
that's understandable so i changed my name to this right away but have still not been able to get in

lonis (Sun, 21 Nov 2021 11:14:08 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=JbnSTaJfTiLnZt8it) yep have tried doing that but didn't help unfortunately

lonis (Sun, 21 Nov 2021 11:14:08 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=JbnSTaJfTiLnZt8it) yep tried doing that but didn't help unfortunately

lonis (Sun, 21 Nov 2021 11:14:24 GMT):
I'm running a macbook pro M1!

lonis (Sun, 21 Nov 2021 11:15:19 GMT):
sent this guide along to a friend who runs Ubuntu and he got the same error https://solang.readthedocs.io/en/latest/installing.html

lonis (Sun, 21 Nov 2021 11:15:51 GMT):

Screenshot 2021-11-21 at 11.15.39.png

lonis (Sun, 21 Nov 2021 11:15:58 GMT):
https://github.com/rust-lang/rust/issues/89195

seanyoung (Sun, 21 Nov 2021 11:16:29 GMT):
solang builds fine with rust stable, no need for nightly.

seanyoung (Sun, 21 Nov 2021 11:16:47 GMT):
The dockerfile shouldn't use rust nightly either

seanyoung (Sun, 21 Nov 2021 11:17:54 GMT):
docker on m1 has issues running x64 intel docker images, sometimes.

seanyoung (Sun, 21 Nov 2021 11:19:05 GMT):
You could install rust on your mbp, download llvm for m1 https://github.com/hyperledger-labs/solang/releases/download/llvm13.0-1/llvm13.0-mac-arm.tar.xz and build solang that way.

seanyoung (Sun, 21 Nov 2021 11:19:47 GMT):
ideally we should have an arm docker image, that should work better. I've got an arm linux machine which I haven't set up yet.

seanyoung (Sun, 21 Nov 2021 11:20:45 GMT):
another option is to use the solang release from https://github.com/hyperledger-labs/solang/releases/tag/v0.1.9 although that doesn't help with solang development, nor does it have the latest fixes

lebdron (Mon, 22 Nov 2021 09:41:12 GMT):
@seanyoung Hello! Is this contract expected to be working? ``` pragma solidity >= 0.7.5; contract FallbackContract { event GotPaid(address sender, uint value); receive() external payable { emit GotPaid(msg.sender, msg.value); } } ``` Because I get `thread 'main' panicked at 'no entry found for key', src/emit/mod.rs:4184:40`

lebdron (Mon, 22 Nov 2021 09:41:12 GMT):
@seanyoung Hello! Is this contract expected to be working? ``` pragma solidity >= 0.7.5; contract FallbackContract { event GotPaid(address sender, uint value); receive() external payable { emit GotPaid(msg.sender, msg.value); } } ``` Because I get `thread 'main' panicked at 'no entry found for key', src/emit/mod.rs:4184:40` I'm using version v0.1.9

seanyoung (Mon, 22 Nov 2021 09:52:16 GMT):
@lebdron that is clearly broken. Let me have a look

seanyoung (Mon, 22 Nov 2021 14:37:33 GMT):
ok I have a fix for it. Now I need to write some test cases.

lebdron (Mon, 22 Nov 2021 15:03:31 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=9qMqrkj8tb4qcyhwe) Great, thank you! Maybe it's even worth a patch release :)

lebdron (Mon, 22 Nov 2021 15:04:45 GMT):
I think there is one more issue. If the contract file starts like this, for example: ``` /** *Submitted for verification at Etherscan.io on 2017-06-16 */ pragma solidity 0.4.11; ``` I get ``` error: unrecognised token `pragma', expected "(", "[", "abstract", "address", "bool", "bytes", "constructor", "contract", "enum", "event", "fallback", "false", "function", "interface", "library", "mapping", "modifier", "payable", "receive", "string", "struct", "this", "true", Bytes, DocComment, Int, Uint, address, hexnumber, hexstring, identifier, number, rational, string Line 4: pragma solidity 0.4.11; ^^^^^^ error: not all contracts are valid ```

seanyoung (Mon, 22 Nov 2021 15:07:05 GMT):
I think the parser thinks that `/**` is a doc comment, and pragma can't have a doc comment.

seanyoung (Mon, 22 Nov 2021 15:07:16 GMT):
Let me check once I have the receive working

seanyoung (Mon, 22 Nov 2021 17:25:10 GMT):
@lebdron I've fixed both issues here: https://github.com/hyperledger-labs/solang/pull/576 waiting for CI to pass

lebdron (Mon, 22 Nov 2021 17:51:43 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=JDHTLyWPibYzaf4Si) That's great, thank you very much!

seanyoung (Mon, 29 Nov 2021 16:14:24 GMT):
@here here is any interesting opportunity. solang does not currently support cosmos, but this could be added. Looks like the cosmos foundation (interchain foundation) is willing to give a grant to anyone who wants to do that, see https://github.com/hyperledger-labs/solang/issues/582 I'd love to see cosmos support in solang, so I am available to help (to point in the right direction, explain parts of solang,etc. I don't have much time for writing cosmos support myself).

mryalamanchi (Mon, 29 Nov 2021 17:24:28 GMT):
Has joined the channel.

lebdron (Tue, 30 Nov 2021 12:51:44 GMT):
@seanyoung I wonder if adding linux-arm64 target to CI is possible or not. It would be nice in the setup of VMs on M1

lebdron (Tue, 30 Nov 2021 12:52:06 GMT):
And building LLVM locally in that VM is problematic

seanyoung (Tue, 30 Nov 2021 13:00:09 GMT):
@lebdron we'd need an linux arm64 machine to run the CI for that.

seanyoung (Tue, 30 Nov 2021 13:01:12 GMT):
I'd love to add linux arm64. I do have this machine sitting in cupboard, waiting for me to set it up. https://www.crowdsupply.com/traverse-technologies/ten64 It's not very fast though, takes about 30 minutes for a solang build.

seanyoung (Tue, 30 Nov 2021 13:02:36 GMT):
Ideally I'd like a much faster linux arm64 server.

seanyoung (Tue, 30 Nov 2021 13:03:00 GMT):
If we had that, we could create docker images for both x86 and arm64.

mryalamanchi (Tue, 30 Nov 2021 13:53:03 GMT):
Hello Sean. May I know what's the dev roadmap for Solang as of now for supporting Solana and other blockchains?

seanyoung (Tue, 30 Nov 2021 16:40:35 GMT):
@mryalamanchi work is underway for Solana, most of all. I'm working on spl-token compatibility and when that is done, the next step is working on anchor compatibility (if possible). As for other blockchains, this is dependant on contributions.

mryalamanchi (Tue, 30 Nov 2021 17:26:18 GMT):
Would love to know more about the Solana path. As I understand, it's the HL team is mainly adding support for Solana rn. Are the tasks open to the community to implement anytime soon for speed up?

seanyoung (Wed, 01 Dec 2021 00:43:46 GMT):
Of course we would be very grateful for contributions. Do you have any particular interest? If you're interested in a particular blockchain I can list what issues need working on. I should really create a to-do issue in github.

lebdron (Wed, 01 Dec 2021 10:32:30 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=SdjKAKADfBaGH6z5r) is this together with the llvm build? because then it sounds reasonable. it took a while to build on my M1 Air with qemu VM

seanyoung (Wed, 01 Dec 2021 10:33:07 GMT):
Yes, this would also do the llvm build

lebdron (Wed, 01 Dec 2021 10:33:56 GMT):
I also have a question because I think it'll be easier than figuring out now by myself. Does the llvm build use any additional libraries on CI now? I built it just having ninja,gcc,g++,cmake installed

seanyoung (Wed, 01 Dec 2021 10:34:42 GMT):
It doesn't use any additional libraries, they should be all turned off

lebdron (Wed, 01 Dec 2021 10:34:46 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=t2iRghCGNn6ZCJu3t) Considering that llvm is not updated that often, maybe it might be even beneficial to have separate builds

lebdron (Wed, 01 Dec 2021 10:34:55 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=ffGMEHkxYMPEhiHxz) Got it, thanks!

seanyoung (Wed, 01 Dec 2021 10:37:53 GMT):
llvm is only built with releases, it is not built for every pull/push. That would take far too long

lebdron (Wed, 01 Dec 2021 12:47:27 GMT):
By the way, what do you think about using `git describe --tags` for `solang --version` command? then the output will not be empty when you build any commit

seanyoung (Wed, 01 Dec 2021 13:47:33 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=5uBsMjav9mPBPJziW) It should be doing that, it must be broken for you. In `build.rs` the environment `GIT_HASH` is set https://github.com/hyperledger-labs/solang/blob/main/build.rs#L49-L54 Then for `--version`, `GIT_HASH` is used: https://github.com/hyperledger-labs/solang/blob/main/src/bin/solang.rs#L45

seanyoung (Wed, 01 Dec 2021 13:49:59 GMT):
@lebdron I've started working on multi arch docker images: https://github.com/hyperledger-labs/solang/commit/a80a3b4007cc4cb0bf263b51c36dbde8f6262725 That's a start for proper linux arm64 support.

seanyoung (Wed, 01 Dec 2021 13:53:04 GMT):

flipper.png

seanyoung (Wed, 01 Dec 2021 13:54:56 GMT):
In the process I've fixed a few things in the ast. The should be a lot less synthetic nodes, all the nodes should be actual stuff that was parsed. For example there are no return nodes added for functions without a return statement (this will be done during codegen).

JosephPotts (Wed, 01 Dec 2021 19:36:21 GMT):
Has joined the channel.

JosephPotts (Wed, 01 Dec 2021 19:36:21 GMT):
hey guys

JosephPotts (Wed, 01 Dec 2021 19:36:58 GMT):
had a question about solang - do you think i can do full-fledge development in Solidity to deploy solana programs using Solang?

seanyoung (Thu, 02 Dec 2021 09:59:15 GMT):
@JosephPotts of course! As this is relatively new software, you may come across issues. I've been keeping on top of new issues so hopefully if you do find anything, I can resolve it quickly. Currently you can't use spl-token from Solidity, or call non-solidity contracts. That is still in the works.

lebdron (Thu, 02 Dec 2021 10:17:25 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=tp2StTJRNEq2u3B6j) looks great, thank you!

lebdron (Thu, 02 Dec 2021 10:19:20 GMT):
I have one more question though... I try to deploy the contract with the private validator network, and my deployment gets stuck in the last transaction which contains data account creation and constructor call. Could you tell how is it possible to debug this? Basically, the transaction stays "confirmed" and does not become "finalized" in reasonable time

lebdron (Thu, 02 Dec 2021 15:40:19 GMT):
@seanyoung I think I started getting a new error: `Transaction simulation failed: Error processing Instruction 0: instruction modified the program id of an account`

seanyoung (Thu, 02 Dec 2021 15:50:43 GMT):
@lebdron that's interesting. I'd like to reproduce that problem, would you mind sending your files and steps please?

lebdron (Thu, 02 Dec 2021 15:55:59 GMT):
I am using solang v0.1.9-43-g8f2090d, solana 1.8.5, all compiled for linux-arm64

seanyoung (Thu, 02 Dec 2021 15:56:15 GMT):
and your solidity/client code?

lebdron (Thu, 02 Dec 2021 15:58:16 GMT):
https://github.com/NatoliChris/diablo-benchmark/pull/14/files#diff-d96fd513a94bedc0ec42fdef7b2b980a96fa5296c5d20eac6040a4bb72b85a57R357

lebdron (Thu, 02 Dec 2021 15:58:38 GMT):
In solanaworkloadgenerator.go

seanyoung (Thu, 02 Dec 2021 16:17:01 GMT):
@lebron very nice work!

lebdron (Thu, 02 Dec 2021 16:24:54 GMT):
thank you! :) I'll try to rerun everything on x86_64 and pre-compiled solang 0.1.9 now, hopefully it will work

seanyoung (Thu, 02 Dec 2021 17:43:10 GMT):
I'll try and reproduce the problem here

lebdron (Thu, 02 Dec 2021 18:46:15 GMT):
Yes, it works OK on x86_64

seanyoung (Thu, 02 Dec 2021 18:59:43 GMT):
That's interesting.

seanyoung (Thu, 02 Dec 2021 19:25:57 GMT):
you can build solang for mac m1 without docker. There is an llvm build for mac m1 here: https://github.com/hyperledger-labs/solang/releases/download/llvm13.0-1/llvm13.0-mac-arm.tar.xz

seanyoung (Thu, 02 Dec 2021 19:26:08 GMT):
having said that it would be nice to have the docker side sorted

lucasste (Mon, 06 Dec 2021 16:28:46 GMT):
Solang has now more than 500 starts on Github :partying_face:

lucasste (Mon, 06 Dec 2021 16:28:46 GMT):
Solang has now more than 500 stars on Github :partying_face:

ashritha2410 (Tue, 07 Dec 2021 10:16:22 GMT):
Has joined the channel.

ashritha2410 (Tue, 07 Dec 2021 10:16:22 GMT):
Hi, I am using solana-solidity.js package to deploy solidity code. It works fine if the connection is to localhost:8899. On Devnet/Testnet it works fine till contract deployment but while accessing the contract functions, it throws the following error TransactionError: ELF error: Unresolved symbol (sol_set_return_data) at instruction #11077 (ELF file offset 0x15940) Any idea on how to interact with contract functions

seanyoung (Tue, 07 Dec 2021 14:00:55 GMT):
@ashritha2410 So for now, it will not work on solana testnet/devnet. There are some new features which should be enabled, unfortunately I myself made a stupid mistake and now we're going to have to wait until the next version is rolled out (which won't be long)

seanyoung (Tue, 07 Dec 2021 14:02:24 GMT):
I'm just fixing things now..

lebdron (Tue, 07 Dec 2021 14:13:09 GMT):
@seanyoung good day! I was wondering if there is a way to get in touch with the validator dev team regarding the general works of validator? Somehow my transactions are not getting committed after being accepted with SendTransaction. I am trying to debug it, but without knowing the whole architecture, it's quite complicated. For example, enabling debug logs only reveled for me that there is a response with missing hash that I see on the client, but no other mentions of the same transaction in other components.

seanyoung (Tue, 07 Dec 2021 14:34:57 GMT):
@lebron your best bet is `#developer-support` on solana discord

seanyoung (Tue, 07 Dec 2021 14:35:34 GMT):
is there anything special about the transactions?

seanyoung (Tue, 07 Dec 2021 14:35:51 GMT):
how many validator nodes are you running?

lebdron (Tue, 07 Dec 2021 14:36:28 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=fSMkpGNtepsLxAGGf) Single node. I can test it with multiple nodes, but I guess if there are problems with a single node, adding more won't help

lebdron (Tue, 07 Dec 2021 14:38:30 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=KwuakrJk9mbpmQFSJ) Not really. For example, I try to create nonce accounts for 120000 existing accounts in the ledger. When I send the transactions, they all get accepted, as "signature is returned from the validator", but then listening for the roots and querying the finalized blocks, it sometimes(!) get stuck with couple of signatures missing. And when I query those signatures with `GetSignatureStatuses`, it returns `null`, as node never received such transaction.

lebdron (Tue, 07 Dec 2021 14:39:40 GMT):
So there are 120000 identical transactions in terms of logic, just interacting with different accounts. And 10-100 txs got lost in the end sometimes(!)

lebdron (Tue, 07 Dec 2021 14:39:40 GMT):
So there are 120000 identical transactions in terms of logic, just interacting with different accounts. And 10-100 txs get lost in the end sometimes(!)

lebdron (Tue, 07 Dec 2021 14:41:14 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=2RvhiyiCWucf58hKL) I tried that, but maybe I'm not lucky with the central European time zone, so I only get community support people, not devs

seanyoung (Tue, 07 Dec 2021 15:09:46 GMT):
ok so you're trying to run as many solana transactions as possible, and some transactions get a transaction signature, but somehow don't get committed?

lebdron (Tue, 07 Dec 2021 15:10:59 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=WxmDmFc25xn8ZFcvK) Yes, I wouldn't say "as many as possible", but yes

seanyoung (Tue, 07 Dec 2021 15:11:08 GMT):
ok :)

lebdron (Tue, 07 Dec 2021 15:12:09 GMT):
Examining the logs, I see that for finalized transactions, the signature appears in bank and solana_runtime::cost_model, but there are no such messages for the missing transactions

seanyoung (Tue, 07 Dec 2021 15:14:07 GMT):
Very odd. when you establish a connection to solana, and also when you send the transaction, there is `commitment` level. What are you specifiying?

lebdron (Tue, 07 Dec 2021 15:14:52 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=LPRcynwkuzbEfWyTu) Finalized, that's the idea of the benchmark

lebdron (Tue, 07 Dec 2021 15:14:52 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=LPRcynwkuzbEfWyTu) "Finalized", that's the idea of the benchmark

seanyoung (Tue, 07 Dec 2021 15:46:11 GMT):
@lebdron how do I reproduce this?

lebdron (Tue, 07 Dec 2021 16:08:50 GMT):
[ ](https://chat.hyperledger.org/channel/solang?msg=CJSKrcpdLJA9BGA3M) Good question! I'll try to make a minimal reproducible example, but it requires a network with (at least?) 120000 created accounts, because the whole thing is flaky. So first, I generate 120000 accounts with the bench tool, create a genesis block with the provided script and run the bootstrap validator script.

seanyoung (Tue, 07 Dec 2021 16:18:50 GMT):
That would be great!

lebdron (Tue, 07 Dec 2021 16:58:23 GMT):
OK, I "fixed" the problem by running multiple nodes! That's very interesting client-side API implementation on Solana side, I think :D

seanyoung (Tue, 07 Dec 2021 16:58:56 GMT):
that's odd!

lebdron (Tue, 07 Dec 2021 16:59:51 GMT):
So with running 5 nodes, and rotating the nodes (e.g. doing (i++ mod N)) I send transactions to, they don't disappear!

seanyoung (Tue, 07 Dec 2021 17:00:20 GMT):
Very strange

lebdron (Tue, 07 Dec 2021 17:03:26 GMT):
Well I'll still try to make a MWE and share as I can

seanyoung (Tue, 07 Dec 2021 20:44:52 GMT):
perfect

kennylau89 (Wed, 08 Dec 2021 02:06:02 GMT):
Has joined the channel.

kennylau89 (Wed, 08 Dec 2021 02:06:03 GMT):
hi guys , was wondering any examples of solidity based code for NFT minting compiled using solang. Tried openzepplin to create a smart contract and it seems to be impossible to be compiled via solang.

seanyoung (Wed, 08 Dec 2021 11:18:43 GMT):
@kennylau89 Solidity on Solana will need minor codes changes to make it work.

seanyoung (Wed, 08 Dec 2021 11:20:04 GMT):
@kennylau89 is there a specific contract you have in mind?

seanyoung (Wed, 08 Dec 2021 13:28:38 GMT):
The solang docker images are now multiarch: they contain both arm64 and amd64 layers. So, the containers will natively on mac m1s. See https://github.com/hyperledger-labs/solang/pkgs/container/solang @lebdron

seanyoung (Wed, 08 Dec 2021 13:28:38 GMT):
The solang docker images are now multiarch: they contain both arm64 and amd64 layers. So, the containers will run natively on mac m1s. See https://github.com/hyperledger-labs/solang/pkgs/container/solang @lebdron

kennylau89 (Fri, 10 Dec 2021 01:55:38 GMT):
@seanyoung , We've tried to import the openzepplin library in and use it but it seems that there are lots of functions not supported. As read in the docs , evm assembly is not supported in solang so what work arounds would you suggest ? Here is the github `link https://github.com/wemingTT/solana-solidity.js/tree/master/project`

kennylau89 (Fri, 10 Dec 2021 01:55:38 GMT):
@seanyoung , We've tried to import the openzepplin library in and use it but it seems that there are lots of functions not supported. As read in the docs , evm assembly is not supported in solang so what work arounds would you suggest ? Here is the github link `https://github.com/wemingTT/solana-solidity.js/tree/master/project`

kennylau89 (Fri, 10 Dec 2021 01:55:38 GMT):
@seanyoung , We've tried to import the openzepplin library in and use it but it seems that there are lots of functions not supported. As read in the docs , evm assembly is not supported in solang so what work arounds would you suggest ? Here is the github link `https://github.com/wemingTT/solana-solidity.js/tree/master/project` `https://github.com/wemingTT/solana-solidity.js/blob/master/error/evm_error.png`

kennylau89 (Fri, 10 Dec 2021 01:55:38 GMT):
@seanyoung , We've tried to import the openzepplin library in and use it but it seems that there are lots of functions not supported. As read in the docs , evm assembly is not supported in solang so what work arounds would you suggest ? Here is the github link `https://github.com/wemingTT/solana-solidity.js/tree/master/project` Error Image: `https://github.com/wemingTT/solana-solidity.js/blob/master/error/evm_error.png`

kennylau89 (Fri, 10 Dec 2021 01:55:38 GMT):
@seanyoung , We've tried to import the openzepplin library in and use it but it seems that there are lots of functions not supported. As read in the docs , evm assembly is not supported in solang so what work arounds would you suggest ? Here is the github link https://github.com/wemingTT/solana-solidity.js/tree/master/project Error Image: `https://github.com/wemingTT/solana-solidity.js/blob/master/error/evm_error.png`

kennylau89 (Fri, 10 Dec 2021 01:55:38 GMT):
@seanyoung , We've tried to import the openzepplin library in and use it but it seems that there are lots of functions not supported. As read in the docs , evm assembly is not supported in solang so what work arounds would you suggest ? Here is the github link https://github.com/wemingTT/solana-solidity.js/tree/master/project Error Image: https://github.com/wemingTT/solana-solidity.js/blob/master/error/evm_error.png

seanyoung (Mon, 13 Dec 2021 10:19:07 GMT):
@kennylau89 we would need to look at each error individually to fix this.

seanyoung (Mon, 13 Dec 2021 10:20:01 GMT):
Things like `staticcall` and `delegatecall` are ethereum-isms that just don't exist on any other blockchain

seanyoung (Tue, 14 Dec 2021 09:18:01 GMT):
@all Substrate have a position for someone to work Solang https://boards.greenhouse.io/parity/jobs/4852012003

seanyoung (Tue, 14 Dec 2021 09:18:01 GMT):
@all Substrate have a position for someone to work on Solang https://boards.greenhouse.io/parity/jobs/4852012003

seanyoung (Tue, 14 Dec 2021 09:19:33 GMT):
(Substrate is made by Parity Tech)

lucasste (Mon, 27 Dec 2021 20:07:46 GMT):
Is copy propagation implemented in Solang? It would make common subexpression elimination more efficient

seanyoung (Tue, 28 Dec 2021 16:49:36 GMT):
The constant folding pass does copy propagation as well.

lucasste (Sat, 08 Jan 2022 18:03:29 GMT):
Which LLVM optimizations passes are enable in Solang?

lucasste (Sat, 08 Jan 2022 18:03:29 GMT):
Which LLVM optimizations passes are enabled] in Solang?

lucasste (Sat, 08 Jan 2022 18:03:29 GMT):
Which LLVM optimizations passes are enabled in Solang?

seanyoung (Sat, 08 Jan 2022 23:27:31 GMT):
solang create a pass manager and set a few, and also sets an optimization level which in turn enables some optimization passes. See kernel reports TIME_ERROR: 0x2041: Clock Unsynchronized

seanyoung (Sat, 08 Jan 2022 23:27:31 GMT):
solang create a pass manager and set a few, and also sets an optimization level which in turn enables some optimization passes. https://github.com/hyperledger-labs/solang/blob/main/src/emit/mod.rs#L5632-L5642

seanyoung (Sat, 08 Jan 2022 23:27:44 GMT):
With llvm you set passes with the pass manager

seanyoung (Sun, 09 Jan 2022 12:01:51 GMT):
@lucasste that should have been https://github.com/hyperledger-labs/solang/blob/main/src/emit/mod.rs#L5632-L5642

seanyoung (Fri, 28 Jan 2022 10:06:23 GMT):
This is a new crate for nicely formatted compiler error messages: https://github.com/zesterer/ariadne

lucasste (Mon, 31 Jan 2022 14:11:32 GMT):
I had a look at `src/emit`. It looks like you have different code for each target. I thought that you just emitted LLVM code and it would take care of generating code for either Solana or Webassembly.

seanyoung (Mon, 31 Jan 2022 16:56:33 GMT):
@lucasste the bulk of the code emitter is in `src/emit/mod.rs` but all the blockchain-specific parts are in their own file.

seanyoung (Mon, 31 Jan 2022 16:57:04 GMT):
Each blockchain has different methods for accessing state, or time, or calling other smart contracts.

seanyoung (Mon, 31 Jan 2022 16:57:33 GMT):
Also the entry point for each blockchain is totally different

seanyoung (Mon, 31 Jan 2022 16:59:30 GMT):
Both ewasm and substrate use webassembly, but there is a lot of differences between the two

lucasste (Thu, 10 Feb 2022 16:34:45 GMT):
Is this channel moving to discord as well?

seanyoung (Thu, 10 Feb 2022 18:28:47 GMT):
Yes, there is a solang channel on the hyperledger discord server