Re: [Pharo-users] Seaside not installing

2016-09-12 Thread Hersh Krishna via Pharo-users
--- Begin Message ---
All right, that push seemed to fix it. Thanks for helping me out. I thought I
was going insane since I always seem to get the wierdest errors.



--
View this message in context: 
http://forum.world.st/Seaside-not-installing-tp4915283p4915290.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

--- End Message ---


Re: [Pharo-users] Seaside not installing

2016-09-12 Thread Hersh Krishna via Pharo-users
--- Begin Message ---
I'm on Pharo 5 currently. Its the latest image you get from the shell script
on the download page.



--
View this message in context: 
http://forum.world.st/Seaside-not-installing-tp4915283p4915288.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

--- End Message ---


Re: [Pharo-users] Seaside not installing

2016-09-12 Thread Esteban A. Maringolo
I just uploaded a new Metacello config that, I hope, fixes a reference
to Cryptography package that for some reason stopped working.

After changing this I had 1010 (all) Seaside-Tests passing.


Name: ConfigurationOfSeaside3-EstebanMaringolo.312
Author: EstebanMaringolo
Time: 13 September 2016, 1:04:36.108636 am
UUID: 57a8dff5-a6da-4e91-be29-7628e93171ae
Ancestors: ConfigurationOfSeaside3-pmm.311

Fixes #baseline320security: that had a specific spec and package
reference for Pharo that wasn't working. Now it uses the same
#squeakCommon spec.

Regards,

Esteban A. Maringolo


2016-09-12 23:22 GMT-03:00 Ben Coman :
> On Tue, Sep 13, 2016 at 10:09 AM, Hersh Krishna via Pharo-users
>  wrote:
>>
>> -- Forwarded message --
>> From: Hersh Krishna 
>> To: pharo-users@lists.pharo.org
>> Cc:
>> Date: Mon, 12 Sep 2016 19:05:06 -0700 (PDT)
>> Subject: Seaside not installing
>> When I try to install seaside via the Catalog Browser I get an error
>> "MetacelloNameNotDefinedError", which says that a crypto library is missing.
>> Is this my fault or is the build just broken right now?
>
> Hi Hersh,
>
> Which version of Pharo are you on?
>
> cheers -ben
>



Re: [Pharo-users] Seaside not installing

2016-09-12 Thread Ben Coman
On Tue, Sep 13, 2016 at 10:09 AM, Hersh Krishna via Pharo-users
 wrote:
>
> -- Forwarded message --
> From: Hersh Krishna 
> To: pharo-users@lists.pharo.org
> Cc:
> Date: Mon, 12 Sep 2016 19:05:06 -0700 (PDT)
> Subject: Seaside not installing
> When I try to install seaside via the Catalog Browser I get an error
> "MetacelloNameNotDefinedError", which says that a crypto library is missing.
> Is this my fault or is the build just broken right now?

Hi Hersh,

Which version of Pharo are you on?

cheers -ben



[Pharo-users] Seaside not installing

2016-09-12 Thread Hersh Krishna via Pharo-users
--- Begin Message ---
When I try to install seaside via the Catalog Browser I get an error
"MetacelloNameNotDefinedError", which says that a crypto library is missing.
Is this my fault or is the build just broken right now?



--
View this message in context: 
http://forum.world.st/Seaside-not-installing-tp4915282.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

--- End Message ---


Re: [Pharo-users] Problem cleaning up image

2016-09-12 Thread Vitor Medina Cruz
Ok, I did some extra tests and I think I figured what is happening: the
code I load on the image subject to clean has a startUp method that starts
a Teapot server on port 8080. I tried various scenarios:

1- Load a fresh image from get.pharo.org and execute clean --> Ok
2- Load a fresh image from get.pharo.org only with the dependencies from my
project (ConfigurationOfTwitterChallenge), one at a time, and execute clean
--> Ok
3- Load a fresh image from get.pharo.org, apply
ConfigurationOfTwitterChallenge and execute clean --> Fail
4- Load a fresh image from get.pharo.org, apply
ConfigurationOfTwitterChallenge and execute eval "TwitterChallengeMain
stopDefaultExecution. ImageCleaner cleanUpForProduction. Smalltalk
snapshot: true andQuit: true." --> *Ok *(Assuming  ImageCleaner
cleanUpForProduction. Smalltalk snapshot: true andQuit: true. does the same
as clean --production)

It appears I cannot clean an Image with the server started. Question: is
that an error or I really should not try to clean an image with a server
on? If the former I open an issue on FogBuz and I will try on a
not-headless vm to see if some error happen.

Regards,
Vitor



On Mon, Sep 12, 2016 at 6:59 AM, stepharo  wrote:

> Ok may be this is just an endless loop :)
>
>
>
> Le 12/9/16 à 10:22, Marcus Denker a écrit :
>
> Hello,
>
> Yes, this is a bug that we really need to fix.
> (sadly no information to add other thant that).
>
> On 09 Sep 2016, at 15:16, Vitor Medina Cruz  wrote:
>
> Hello,
>
> Isn't cleanup the headless image working right now? I know it has some
> problems, but I tried to:
>
> curl get.pharo.org | bash
> ./pharo Pharo.image clean --production
>
> It runs for hours and don't complete. Last time I leave it for about 5
> hours before I cancelled.
>
> Regards,
> Vitor
>
>
>
>


Re: [Pharo-users] Cryptography packages

2016-09-12 Thread Ben Coman
On Tue, Sep 13, 2016 at 2:49 AM, Esteban A. Maringolo 
wrote:

> Who is the author of the to-be announced library?
>

I guess Stef was being deliberately vague allowing the author's convenience
to make the announcement.

cheers -ben


>
> Regards!
>
> Esteban A. Maringolo
>
>
> 2016-09-12 15:17 GMT-03:00 stepharo :
> > Hi esteban
> >
> > I know that there will be an announce about bitcoin library in Pharo so I
> > can put you in contact with the author.
> >
> > Stef
> >
> >
> > Le 12/9/16 à 14:42, Esteban A. Maringolo a écrit :
> >
> >> 2016-09-11 14:26 GMT-03:00 Paul DeBruicker :
> >>>
> >>> Years ago when Squeaksource was "going away"  I made a copy of its
> >>> Cryptography repo here:
> >>> http://smalltalkhub.com/#!/~Cryptography/Cryptography
> >>
> >> I saw it before posting to the list, but the latest commit is from
> >> three years go.
> >>
> >> I'm reading a book about Bitcoin/Blockchains and I want to follow the
> >> examples using my favorite language instead of Python.
> >> Probably not all the algorithms will be there, particularly ECC, but
> >> at least the ones for hashing should.
> >>
> >> Regards!
> >>
> >>
> >> Esteban A. Maringolo
> >>
> >>
> >
> >
>
>


[Pharo-users] SPLASH'16 Amsterdam: Call For Participation

2016-09-12 Thread Tijs van der Storm
#
ACM Conference on Systems, Programming, Languages, and Applications:
Software for Humanity (SPLASH'16)
#

Amsterdam, The Netherlands
Sun 30th October - Fri 4th November , 2016

http://2016.splashcon.org
https://twitter.com/splashcon
https://www.facebook.com/SPLASHCon/


** REGISTRATION **

30 September 2016 (Early Deadline)
Contact: i...@splashcon.org
http://2016.splashcon.org/attending/registration

# What's happening at SPLASH?

## Keynotes

- Benjamin Pierce (SPLASH)
  The Science of Deep Specification

- Andy Ko (SPLASH)
  A Human View of Programming Languages

- Martin Odersky (SPLASH)

- Guy Steele Jr. (SPLASH-I)

- Robby Findler (SLE)
  Redex: Lightweight Semantics Engineering

- Tiark Rompf (GPCE)
  Lightweight Modular Staging: Generate all the things!

- Simon Peyton Jones (SPLASH-I/E)
  The dream of a lifetime: shaping how our children learn computing

- Laurence Tratt (Scala)


## Workshop Keynotes

- Andrew Black (NOOL)
- Alan Blackwell (PLATEAU)
- Alastair Donald (WODA)
- Sam Guyer (WODA)
- Felienne Hermans (DSLDI)
- Ben Liblit (WODA)
- Benjamin Livshits (WODA)
- Ivano Malavolta (Mobile!)
- Yannis Smaragdakis (WODA)
- Frank Tip (WODA)
- Markus Voelter (ITSLE)


** Conference Program **

http://2016.splashcon.org/program/program-splash2015

** SPLASH-I Track **

SPLASH-I is a series of invited and solicited talks that address topics
relevant to the SPLASH community. Speakers are world-class experts in their
field, selected and invited by the organizers. The SPLASH-I talks series is
held in parallel with the rest of SPLASH during the week days. Talks are
open to all attendees.

A selection of confirmed talks:

- Edwin Brady
  Type-driven Development in Idris

- Jürgen Cito
  Using Docker Containers to Improve Reproducibility in PL/SE Research

- Yvonne Coady
  Exploratory Analysis in Virtual Reality: The New Frontier

- Adam Chlipala
  Rapid Development of Web Applications with Typed Metaprogramming in Ur/Web

- Tudo Girba
  Software Environmentalism

- Brian Harvey
  Snap! Scheme Disguised as Scratch

- Lennart Kats
  Responsive Language Tooling For Cloud-based IDEs

- Ralf Laemmel
  The basic skill set of software language engineering

- Crista Lopes
  Simulating Cities: The Spacetime Framework

- Heather Miller
  Language Support for Distributed Systems

- Mark Miller & Bill Tulloh
  The elements of decision alignment: Large programs as complex
organizations

- Boaz Rosenan & David Lorenz
  Define Your App, Don’t Implement It: Building a Scalable Social Network
in 45 minutes

- Emmanuel Schanzer
  Bootstrap

- Chris Seaton
  Truffle and Graal: Fast Programming Languages With Modest Effort

- Emma Söderbergh
  From Tricorder to Tricium: Useful Static Analysis and the Importance of
Workflow Integration

- Emma Tosch
  Designing and Debugging Surveys with SurveyMan

- Todd Veldhuizen
  Fast Datalog

- Markus Völter
  How Domain Requirements Shape Languages

- Jos Warmer
  Making Mendix Meta Model Driven

- Andy Zaidman
  Fact or fiction? What software analytics can do for us (developers and
researchers)



More information here: http://2016.splashcon.org/track/splash2016-splash-i

** Research tracks

- OOPSLA
  http://2016.splashcon.org/track/splash-2016-oopsla#event-overview

- Onward!
  http://2016.onward-conference.org/track/onward-2016-papers#event-overview

- Onward! Essays
  http://2016.onward-conference.org/track/onward2016-essays#program

- Software Language Engineering (SLE)
  http://conf.researchr.org/track/sle-2016/sle-2016-papers#event-overview

- Generative Programming: Concepts & Experiences (GPCE)
  http://conf.researchr.org/track/gpce-2016/gpce-2016-papers#event-overview

- Dynamic Languages Symposium (DLS)
  http://conf.researchr.org/track/dls-2016/dls-2016-papers#event-overview

- Scala Symposium
  http://conf.researchr.org/track/scala-2016/scala-2016#event-overview


** Other Events

- Doctoral Symposium
  http://2016.splashcon.org/track/splash-2016-ds#event-overview

- Programming Language Mentoring Workshop (PLMW)
  http://2016.splashcon.org/track/splash-2016-plmw

- Student Research Competition (SRC)
  http://2016.splashcon.org/track/splash-2016-src

- Posters
  http://2016.splashcon.org/track/splash-2016-posters#event-overview


** Workshops

SPLASH'16 is hosting a record number of 15 workshops:

- AGERE! Programming based on Actors, Agents, and Decentralized Control
  http://2016.splashcon.org/track/agere2016

- DSLDI: Domain-Specific Language Design and Implementation
  http://2016.splashcon.org/track/dsldi2016

- DSM: Domain-Specific Modeling
  http://2016.splashcon.org/track/dsm2016

- FOSD: Feature-oriented Software Development
  http://www.fosd.net/workshop2016

- ITSLE: Industry Track Software Language Engineering
  http://2016.splashcon.org/track/itsle2016

- LWC@SLE: Language Workbench Challenge
  http://2016.splashcon.org/track/lwc2016

- META
  

Re: [Pharo-users] Iceberg and git workflow

2016-09-12 Thread Stephan Eggermont

On 12/09/16 21:51, Christophe Demarey wrote:

I think your scenario is not covered by Iceberg. It could be a nice feature but 
not one of the most important.


Why do you think so?

Stephan





Re: [Pharo-users] Iceberg and git workflow

2016-09-12 Thread Christophe Demarey
Hi Holger,

I think your scenario is not covered by Iceberg. It could be a nice feature but 
not one of the most important. Nicolas will answer but I think he focuses on 
most common scenarios.
In my case, what I miss is to be able to choose what I want to commit. Nicolas 
already planned to add this.

Christophe

> Le 12 sept. 2016 à 16:15, Holger Freyther  a écrit :
> 
> Hi,
> 
> I am a heavy git user with languages like C, C++, Python, Ruby and even GNU 
> Smalltalk and I hope iceberg will bring the same powerful experience to Pharo.
> 
> Last Friday I started to add a bigger refactoring for a new feature to my 
> software and didn't finish. Sadly today an issue in the code was found and I 
> would like to fix this before fixing my code. I use this as opportunity to 
> ask if Iceberg has some answers for that.
> 
> 
> With a non-Pharo project I would do:
> 
> a.) If current HEAD is same as origin/master
> 
> $ git stash (stash away my not finished changes)
> $ vi code.c fix..
> $ git commit -a -c "subject
> 
> long explanation of fix
> reference to bug"
> $ git stash apply (and go back to working on my feature)
> 
> 
> b.) E.g. if I finished n-commits but I am not fully done
> 
> # store my work
> $ git commit -a -m "Work In Progress hack.."
> $ git checkout -b new-feature-branch
> 
> # go back to master
> $ git checkout master 
> $ git reset --hard origin/master (to restore)
> 
> # work on the fix
> $ vi code.c fix..
> $ git commit -a -c "fix..."
> 
> # go back and continue on my fix
> $ git checkout new-feature-branch
> $ git rebase origin/master
> $ git reset HEAD^1
> .. continue to work
> 
> 
> 




Re: [Pharo-users] Spec - Display an ICON without dropping to Morphic

2016-09-12 Thread Brad Selfridge
Whew Thank you for the quick response. 

I'm starting to get my arms around Spec. Thanks for your help. 



-
Brad Selfridge
--
View this message in context: 
http://forum.world.st/Spec-Display-an-ICON-without-dropping-to-Morphic-tp4915253p4915259.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Spec - Display an ICON without dropping to Morphic

2016-09-12 Thread Johan Fabry
Hi Brad,

all forms can be shown as part of a Spec UI. There’s the ImageModel for that. 
For example, supposing you have an ‘icon’ instance variable in your UI, add to 
initializeWidgets:

icon := self newImage.
icon image: (#thumbsUp asIcon).

HTH

--
Does this mail seem too brief? Sorry for that, I don’t mean to be rude! Please 
see http://emailcharter.org .

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
Chile

> On Sep 12, 2016, at 15:40, Brad Selfridge  wrote:
> 
> I want to create a MessagePrompter widget that will display either and error,
> warning, or information message. I want to display a different icon
> associated with each message type. Is there a way to do this in Spec without
> having to drop down into Morphic? 
> 
> I do NOT want to have to learn Morphic. It's taking me enough time trying
> work my way through Spec. 
> 
> 
> 
> -
> Brad Selfridge
> --
> View this message in context: 
> http://forum.world.st/Spec-Display-an-ICON-without-dropping-to-Morphic-tp4915253.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> 
> 




Re: [Pharo-users] Cryptography packages

2016-09-12 Thread Esteban A. Maringolo
Who is the author of the to-be announced library?

Regards!

Esteban A. Maringolo


2016-09-12 15:17 GMT-03:00 stepharo :
> Hi esteban
>
> I know that there will be an announce about bitcoin library in Pharo so I
> can put you in contact with the author.
>
> Stef
>
>
> Le 12/9/16 à 14:42, Esteban A. Maringolo a écrit :
>
>> 2016-09-11 14:26 GMT-03:00 Paul DeBruicker :
>>>
>>> Years ago when Squeaksource was "going away"  I made a copy of its
>>> Cryptography repo here:
>>> http://smalltalkhub.com/#!/~Cryptography/Cryptography
>>
>> I saw it before posting to the list, but the latest commit is from
>> three years go.
>>
>> I'm reading a book about Bitcoin/Blockchains and I want to follow the
>> examples using my favorite language instead of Python.
>> Probably not all the algorithms will be there, particularly ECC, but
>> at least the ones for hashing should.
>>
>> Regards!
>>
>>
>> Esteban A. Maringolo
>>
>>
>
>



[Pharo-users] Spec - Display an ICON without dropping to Morphic

2016-09-12 Thread Brad Selfridge
I want to create a MessagePrompter widget that will display either and error,
warning, or information message. I want to display a different icon
associated with each message type. Is there a way to do this in Spec without
having to drop down into Morphic? 

I do NOT want to have to learn Morphic. It's taking me enough time trying
work my way through Spec. 



-
Brad Selfridge
--
View this message in context: 
http://forum.world.st/Spec-Display-an-ICON-without-dropping-to-Morphic-tp4915253.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Re: [Pharo-users] Cryptography packages

2016-09-12 Thread stepharo

Hi esteban

I know that there will be an announce about bitcoin library in Pharo so 
I can put you in contact with the author.


Stef


Le 12/9/16 à 14:42, Esteban A. Maringolo a écrit :

2016-09-11 14:26 GMT-03:00 Paul DeBruicker :

Years ago when Squeaksource was "going away"  I made a copy of its
Cryptography repo here:
http://smalltalkhub.com/#!/~Cryptography/Cryptography

I saw it before posting to the list, but the latest commit is from
three years go.

I'm reading a book about Bitcoin/Blockchains and I want to follow the
examples using my favorite language instead of Python.
Probably not all the algorithms will be there, particularly ECC, but
at least the ones for hashing should.

Regards!


Esteban A. Maringolo







Re: [Pharo-users] Iceberg and git workflow

2016-09-12 Thread stepharo

Hi Holger

I will let nicolas reply detail.

Now Iceberg is not equals to git.
For that you can already take gitfiletree (whatever is its name) and 
your command line tool and do what you want.
What would be the reason to duplicate git in Pharo? Exposing all the 
complexity of git to pharo?


Iceberg is an abstraction over a distribution source versioning system 
looking like git.

And it offers a process and workflow to manage projects stored in git.
Now iceberg should cover main and common scenario.
And one complex scenario we have is how to manage changes that cross cut 
several projects (pharo / RB / GT...).


Stef


Hi,

I am a heavy git user with languages like C, C++, Python, Ruby and even GNU 
Smalltalk and I hope iceberg will bring the same powerful experience to Pharo.

Last Friday I started to add a bigger refactoring for a new feature to my 
software and didn't finish. Sadly today an issue in the code was found and I 
would like to fix this before fixing my code. I use this as opportunity to ask 
if Iceberg has some answers for that.


With a non-Pharo project I would do:

a.) If current HEAD is same as origin/master

$ git stash (stash away my not finished changes)
$ vi code.c fix..
$ git commit -a -c "subject

long explanation of fix
reference to bug"
$ git stash apply (and go back to working on my feature)


b.) E.g. if I finished n-commits but I am not fully done

# store my work
$ git commit -a -m "Work In Progress hack.."
$ git checkout -b new-feature-branch

# go back to master
$ git checkout master
$ git reset --hard origin/master (to restore)

# work on the fix
$ vi code.c fix..
$ git commit -a -c "fix..."

# go back and continue on my fix
$ git checkout new-feature-branch
$ git rebase origin/master
$ git reset HEAD^1
.. continue to work









[Pharo-users] Iceberg and git workflow

2016-09-12 Thread Holger Freyther
Hi,

I am a heavy git user with languages like C, C++, Python, Ruby and even GNU 
Smalltalk and I hope iceberg will bring the same powerful experience to Pharo.

Last Friday I started to add a bigger refactoring for a new feature to my 
software and didn't finish. Sadly today an issue in the code was found and I 
would like to fix this before fixing my code. I use this as opportunity to ask 
if Iceberg has some answers for that.


With a non-Pharo project I would do:

a.) If current HEAD is same as origin/master

$ git stash (stash away my not finished changes)
$ vi code.c fix..
$ git commit -a -c "subject

long explanation of fix
reference to bug"
$ git stash apply (and go back to working on my feature)


b.) E.g. if I finished n-commits but I am not fully done

# store my work
$ git commit -a -m "Work In Progress hack.."
$ git checkout -b new-feature-branch

# go back to master
$ git checkout master 
$ git reset --hard origin/master (to restore)

# work on the fix
$ vi code.c fix..
$ git commit -a -c "fix..."

# go back and continue on my fix
$ git checkout new-feature-branch
$ git rebase origin/master
$ git reset HEAD^1
.. continue to work





Re: [Pharo-users] UFFI cleanup of externally allocated memory (was Re: UFFI const, unsigned, opaque-ish types)

2016-09-12 Thread Ben Coman
On Mon, Sep 12, 2016 at 6:08 PM, Henrik Johansen <
henrik.s.johan...@veloxit.no> wrote:

>
> On 07 Sep 2016, at 5:38 , Ben Coman  > wrote:
>
> On Wed, Sep 7, 2016 at 10:42 PM, Ben Coman  wrote:
>
> On Wed, Sep 7, 2016 at 9:09 PM, Esteban Lorenzano 
> wrote:
>
>
> On 07 Sep 2016, at 14:56, Ben Coman  > wrote:
>
> On Tue, Sep 6, 2016 at 8:08 PM, Esteban Lorenzano 
> wrote:
>
> Hi,
>
> sorry for arriving so late to this, but I was on holidays :)
> this is how autoRelease works:
>
> 1) #autoRelease of an object registers object for finalisation with a
> particular executor. Then behaviour is divided:
>
> 2.1.1) for ExternalAddresses, it just registers in regular way, who will
> call #finalize on GC
> 2.1.2) finalize will just call a free assuming ExternalAddress was
> allocated
> (which is a malloc)
>
> 2.2.1) for all FFIExternalReference, it will register for finalisation what
> #resourceData answers (normally, the handle of the object)
> 2.2.2) finalisation process will call the object
> class>>#finalizeResourceData: method, with the #resourceData result as
> parameter
> 2.2.3) each kind of external reference can decide how to free that data (by
> default is also just freeing).
>
> An example of this is how CairoFontFace works (or AthensCairoSurface).
>
>
>
> At the bottom of FFIExternalResourceExecutor class comment I read...
>   "Note that in #finalizeResourceData: you cannot
>access any other properties of your instance,
>since it is already garbage collected."
>
> But in my experiments it seems okay to access instance variables in
> #finalize.
> For example...
>
> CXString >> autoRelease
>  self class finalizationRegistry add: self
>
> CXString >> finalize
>   Transcript crShow: 'Finalizing CXString ' ; show: self private_flags.
>   self dispose.
>   Transcript show: ', done!'.
>
> CXString >>private_flags
>   "This method was automatically generated"
>   ^handle unsignedLongAt: 5
>
> Libclang getClangVersion autoRelease.
> Smalltalk garbageCollect.
> "==> Finalizing CXString 1, done! "
>
>
> Is this an unlucky coincidence?   Or maybe something changed from NB
> to UFFI?  (There is a reference to NB there)
>
>
> yes, is a coincidence.
> the idea of using #finalizeResourceData: is that you keep minimal
> information (in general, just the handle)… this way we ensure instances
> will
> be collected because we will not have circular references (preventing the
> weakregistry to work).
>
> In general, you can always implement as you did it, but I would prefer the
> #finalizeResourceData: approach, even for structures.
> The only reason it is not implemented is because I didn’t reach the
> necessity, then I just skipped it (not in purpose, it was not in my head
> :P), but now is a good moment to implement it… if you want it :)
>
>
> Thanks for the offer, but hold off for the moment.  I think I actually
> need more than just finalization session management.  To get a real
> displayable string requires calling the clang_getCString() library
> function.  I imagine I'd like to call this from  CXString>>printOn: --
> but this of course this would break after restarting the image.
>
> extern "C" {
> const char *clang_getCString(CXString string) {
>   
>   return static_cast(string.data);
> }}
>
> typedef struct {
>  const void *data;
>  unsigned private_flags;
> } CXString;
>
> So I think I need to register CXString with SessionManager to set *data
> <-- 0
> on startup.
>
> An alternative might be adding a session variable to CXString,
>FFIExternalStructure subclass: #CXString
>instanceVariableNames: 'session'
>classVariableNames: ''
>poolDictionaries: 'CXStringFlag'
>package: 'Libclang'
>
> except doing so crashes when calling
> getClangVersion
>   ^ self ffiCall: #( CXString clang_getClangVersion () ) module: Libclang
>
>
> So this worked...
>
>  CXString >> resetData
>  handle unsignedLongAt: 1 put: 0.
>
>  CXString class >> startUp: resuming
>  resuming
>  ifTrue: [ self allInstances do: [ :cxs | cxs resetData ] ].
>
>  CXString class >> initialize
>  "self initialize"
>  SessionManager default registerSystemClassNamed: self name
>
>
> Now immediate after a save/restart, doing...
>CXString allInstances first getString   "==> UndefinedObject(nil)"
> instead of crashing the VM.
>
> Can you see/guess any traps hidden from me? Now I wonder early it is
> practical to prioritise such a reset.  My first thought is at least
> before #printString starts getting called ??
>
>
> For traps, there's the assumption in resetData that pointer stored in
> handle is unsignedLong-sized.
> Shouldn't there be auto-generated accessors for #data you can use instead
> to change the value to Pointer void?
>
> Cheers,
> Henry
>

Good point.  This is the auto-generated accessor...

   data: anObject
handle 

Re: [Pharo-users] Cryptography packages

2016-09-12 Thread p...@highoctane.be
FYI there is a binding to NaCl in ApplicationSecurity.

http://80738163270632.blogspot.be/2014/03/application-security-presentation.html

It is Pharo 3 (maybe is ok for other versions but I use it on Pharo 3).

https://nacl.cr.yp.to/index.html

Best,
Phil



On Mon, Sep 12, 2016 at 2:42 PM, Esteban A. Maringolo 
wrote:

> 2016-09-11 14:26 GMT-03:00 Paul DeBruicker :
> >
> > Years ago when Squeaksource was "going away"  I made a copy of its
> > Cryptography repo here:
> > http://smalltalkhub.com/#!/~Cryptography/Cryptography
>
> I saw it before posting to the list, but the latest commit is from
> three years go.
>
> I'm reading a book about Bitcoin/Blockchains and I want to follow the
> examples using my favorite language instead of Python.
> Probably not all the algorithms will be there, particularly ECC, but
> at least the ones for hashing should.
>
> Regards!
>
>
> Esteban A. Maringolo
>
>
>


Re: [Pharo-users] Cryptography packages

2016-09-12 Thread Esteban A. Maringolo
2016-09-11 14:26 GMT-03:00 Paul DeBruicker :
>
> Years ago when Squeaksource was "going away"  I made a copy of its
> Cryptography repo here:
> http://smalltalkhub.com/#!/~Cryptography/Cryptography

I saw it before posting to the list, but the latest commit is from
three years go.

I'm reading a book about Bitcoin/Blockchains and I want to follow the
examples using my favorite language instead of Python.
Probably not all the algorithms will be there, particularly ECC, but
at least the ones for hashing should.

Regards!


Esteban A. Maringolo



Re: [Pharo-users] UFFI cleanup of externally allocated memory (was Re: UFFI const, unsigned, opaque-ish types)

2016-09-12 Thread Henrik Johansen

> On 07 Sep 2016, at 5:38 , Ben Coman  wrote:
> 
> On Wed, Sep 7, 2016 at 10:42 PM, Ben Coman  > wrote:
>> On Wed, Sep 7, 2016 at 9:09 PM, Esteban Lorenzano  
>> wrote:
>>> 
>>> On 07 Sep 2016, at 14:56, Ben Coman  wrote:
>>> 
>>> On Tue, Sep 6, 2016 at 8:08 PM, Esteban Lorenzano 
>>> wrote:
>>> 
>>> Hi,
>>> 
>>> sorry for arriving so late to this, but I was on holidays :)
>>> this is how autoRelease works:
>>> 
>>> 1) #autoRelease of an object registers object for finalisation with a
>>> particular executor. Then behaviour is divided:
>>> 
>>> 2.1.1) for ExternalAddresses, it just registers in regular way, who will
>>> call #finalize on GC
>>> 2.1.2) finalize will just call a free assuming ExternalAddress was allocated
>>> (which is a malloc)
>>> 
>>> 2.2.1) for all FFIExternalReference, it will register for finalisation what
>>> #resourceData answers (normally, the handle of the object)
>>> 2.2.2) finalisation process will call the object
>>> class>>#finalizeResourceData: method, with the #resourceData result as
>>> parameter
>>> 2.2.3) each kind of external reference can decide how to free that data (by
>>> default is also just freeing).
>>> 
>>> An example of this is how CairoFontFace works (or AthensCairoSurface).
>>> 
>>> 
>>> 
>>> At the bottom of FFIExternalResourceExecutor class comment I read...
>>>   "Note that in #finalizeResourceData: you cannot
>>>access any other properties of your instance,
>>>since it is already garbage collected."
>>> 
>>> But in my experiments it seems okay to access instance variables in
>>> #finalize.
>>> For example...
>>> 
>>> CXString >> autoRelease
>>>  self class finalizationRegistry add: self
>>> 
>>> CXString >> finalize
>>>   Transcript crShow: 'Finalizing CXString ' ; show: self private_flags.
>>>   self dispose.
>>>   Transcript show: ', done!'.
>>> 
>>> CXString >>private_flags
>>>   "This method was automatically generated"
>>>   ^handle unsignedLongAt: 5
>>> 
>>> Libclang getClangVersion autoRelease.
>>> Smalltalk garbageCollect.
>>> "==> Finalizing CXString 1, done! "
>>> 
>>> 
>>> Is this an unlucky coincidence?   Or maybe something changed from NB
>>> to UFFI?  (There is a reference to NB there)
>>> 
>>> 
>>> yes, is a coincidence.
>>> the idea of using #finalizeResourceData: is that you keep minimal
>>> information (in general, just the handle)… this way we ensure instances will
>>> be collected because we will not have circular references (preventing the
>>> weakregistry to work).
>>> 
>>> In general, you can always implement as you did it, but I would prefer the
>>> #finalizeResourceData: approach, even for structures.
>>> The only reason it is not implemented is because I didn’t reach the
>>> necessity, then I just skipped it (not in purpose, it was not in my head
>>> :P), but now is a good moment to implement it… if you want it :)
>> 
>> Thanks for the offer, but hold off for the moment.  I think I actually
>> need more than just finalization session management.  To get a real
>> displayable string requires calling the clang_getCString() library
>> function.  I imagine I'd like to call this from  CXString>>printOn: --
>> but this of course this would break after restarting the image.
>> 
>> extern "C" {
>> const char *clang_getCString(CXString string) {
>>   
>>   return static_cast(string.data);
>> }}
>> 
>> typedef struct {
>>  const void *data;
>>  unsigned private_flags;
>> } CXString;
>> 
>> So I think I need to register CXString with SessionManager to set *data <-- 0
>> on startup.
>> 
>> An alternative might be adding a session variable to CXString,
>>FFIExternalStructure subclass: #CXString
>>instanceVariableNames: 'session'
>>classVariableNames: ''
>>poolDictionaries: 'CXStringFlag'
>>package: 'Libclang'
>> 
>> except doing so crashes when calling
>> getClangVersion
>>   ^ self ffiCall: #( CXString clang_getClangVersion () ) module: Libclang
> 
> So this worked...
> 
>  CXString >> resetData
>  handle unsignedLongAt: 1 put: 0.
> 
>  CXString class >> startUp: resuming
>  resuming
>  ifTrue: [ self allInstances do: [ :cxs | cxs resetData ] ].
> 
>  CXString class >> initialize
>  "self initialize"
>  SessionManager default registerSystemClassNamed: self name
> 
> 
> Now immediate after a save/restart, doing...
>CXString allInstances first getString   "==> UndefinedObject(nil)"
> instead of crashing the VM.
> 
> Can you see/guess any traps hidden from me? Now I wonder early it is
> practical to prioritise such a reset.  My first thought is at least
> before #printString starts getting called ??

For traps, there's the assumption in resetData that pointer stored in handle is 
unsignedLong-sized.
Shouldn't there be auto-generated accessors for #data you can use instead to 
change the value to Pointer void?

Cheers,
Henry



Re: [Pharo-users] Problem cleaning up image

2016-09-12 Thread stepharo

Ok may be this is just an endless loop :)



Le 12/9/16 à 10:22, Marcus Denker a écrit :

Hello,

Yes, this is a bug that we really need to fix.
(sadly no information to add other thant that).

On 09 Sep 2016, at 15:16, Vitor Medina Cruz > wrote:


Hello,

Isn't cleanup the headless image working right now? I know it has 
some problems, but I tried to:


curl get.pharo.org  | bash
./pharo Pharo.image clean --production

It runs for hours and don't complete. Last time I leave it for about 
5 hours before I cancelled.


Regards,
Vitor






Re: [Pharo-users] Problem cleaning up image

2016-09-12 Thread Marcus Denker
Hello,

Yes, this is a bug that we really need to fix.
(sadly no information to add other thant that).

> On 09 Sep 2016, at 15:16, Vitor Medina Cruz  wrote:
> 
> Hello,
> 
> Isn't cleanup the headless image working right now? I know it has some 
> problems, but I tried to:
> 
> curl get.pharo.org  | bash 
> ./pharo Pharo.image clean --production
> 
> It runs for hours and don't complete. Last time I leave it for about 5 hours 
> before I cancelled.
> 
> Regards,
> Vitor



Re: [Pharo-users] limits on number of instance variables and class variables

2016-09-12 Thread Clément Bera
Hello Ben,

The limit you see for instance variables is due to:
- Class format encoding (Memory manager dependent)
- Bytecode set encoding (Bytecode set dependent)

The 255 inst var limit is enforced both by:
- the V3 Memory manager
- the SqueakV3PlusClosures bytecode set.

Now we have Spur instead of V3 as a memory manager, which allows up to
65535 instance variables.

The SistaV1 bytecodeset should reach production in Pharo 6 alpha any time
soon, and combined with the Spur memory manager, it enforces a limit of
65535 instance variables instead of 255.

Class variables are indeed a dictionary so there's no hard limit.



On Mon, Sep 12, 2016 at 4:51 AM, Ben Coman  wrote:

> Minor curiosity... I was wondering about the limits on the number of
> instance variables and class variables (particularly the latter regarding
> large FFI enumerations), so I produced a script to experiment with.
>
> Results:
> * Class Variables seem to have no practical limit. Although running 6C
> experiment a second time locks the image for about 3 minutes, but
> eventually completes.
> * Instance Variables limit is 255 or 256.  This not clear since 256 works,
> but the error message** for 257 says the limit is 255.
>** Error: genStorePopInstVarLong: index index 256 is out of range 0
> to 255
>
> cheers -ben
>
> Here is the fun script...
> ""
> "The experiment has two parameters (select by changing the #at: index):
>_RANGE - Range of variables assigned.  Note variables are declared
> starting from 0001.
>_TYPE - (i)instance variable or (C)lass variable"
>
> _RANGE := {
> 1->9. "1. code validation"
> 201->256. "2. instance variables limit"
> 201->257. "3. instance variables Error: genStorePopInstVarLong: index
> index 256 is out of range 0 to 255"
> 201->299. "4. class variables keep going"
> 901->999. "5. class variables go extreme"
> 9901->. "6. class variables go ultra extreme"
> } at: 1.
> _TYPE := {
> 'i'. "1. instance variables"
> 'C'"2. class variables"
> } at: 1.
>
> "Choose experiment parameters above"
>
> start := _RANGE key.
> end := _RANGE value.
>
> "DECLARE VARIABLES"
> vars := ''.
> 1 to: end do: [:n| vars := vars, _TYPE, (n printPaddedWith: $0 to: 4), '
>  ' ].
> vars.
> Object subclass: #Test
> instanceVariableNames: ((_TYPE = 'i') ifTrue: [vars] ifFalse: [ '' ])
> classVariableNames: ((_TYPE = 'C') ifTrue: [vars] ifFalse: [ '' ])
> poolDictionaries: ''
> package: ''.
>
> "First run needs to execute above separately to create the class referred
> below"
>
> "ASSIGN VARIABLES"
> body := '
> '.
> start to: end do: [ :n| body := body , _TYPE, (n printPaddedWith: $0 to:
> 4), ':=' , n printString , '.
> ' ].
> body.
> #Test asClass compile: 'assign ' , body.
>
> "INSPECT VARIABLES"
> body := '
> ^{'.
> start to: end do: [ :n| body := body , _TYPE, (n printPaddedWith: $0 to:
> 4) , '. ' ].
> body.
> Test compile: 'inspect ' , body , '} inspect'.
>
> Test new assign ; inspect.
>
>