Coder Social home page Coder Social logo

grease's People

Contributors

astares avatar dalehenrich avatar janbliznicenko avatar jbrichau avatar jecisc avatar krono avatar marschall avatar noha avatar theseion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grease's Issues

GRUtf8CodecStream Latin1ToUtf8Encodings is a Global ... should be class var

GRUtf8CodecStream
nextPutAll: aString
    "conversion of smaller string is faster if not using the changeClassTo: trick"
    binary
        ifTrue: [ stream nextPutAll: aString asString ]
        ifFalse: [ aString size > 8
                        ifTrue: [ stream nextPutAll: (aString encodeAsUTF8 changeClassTo: String) ]
                        ifFalse: [ | enc  str | enc := aString encodeAsUTF8. 
                                     str := String new: enc size.
                                    1 to: enc size do: [:idx | str at: idx put: (Character value: (enc at: idx)) ].
                                    stream nextPutAll: str ] ]


GRUtf8CodecStream
nextPut: aCharacter
    "old implementation is very slow !!"
"   self nextPutAll: (String with: aCharacter)"
    | codePoint |
    codePoint := aCharacter codePoint.
    codePoint > 127
        ifTrue: [ 
            codePoint > 255
                ifTrue: [ | enc str |
                        enc := (String with: aCharacter) encodeAsUTF8. 
                         str := String new: enc size.
                        1 to: enc size do: [:idx | str at: idx put: (Character value: (enc at: idx)) ].
                        stream nextPutAll: str ]
                ifFalse: [ stream nextPutAll: (Latin1ToUtf8Encodings at: codePoint + 1) ] ]
        ifFalse: [ stream nextPut: aCharacter ]

Filenames with non-ascii chars are not encoded

The GemStone primitives on GsFile are not encoding a filename with non-ascii chars. As a consequence, users must not forget to properly encode these filenames before using the primitives.

For example, executing the following in GemStone 2.4, 3.1 or 3.2 does not open the file because it does not find it.
GRPlatform current contentsOfFile: 'fichier français à importer.txt' binary: false

If we encode the filename, it works:
GRPlatform current contentsOfFile: 'fichier français à importer.txt' encodeAsUTF8 binary: false

I think this might be a GemStone issue that could be fixed if the primitives take the user locale into account. What do you think @dalehenrich ? In the meantime, we might want to abstract this into Grease with a locale that can be set in GRPlatform and that is subsequently used to encode the filename.

Remove #fixCallbackTemps

Now that all the dialects we support have block closure I think it's worth considering removing #fixCallbackTemps

Pharo: PackageManifest

On Pharo we have now a class PackageManifest who can be subclass in all packages of the system to keep meta datas (for example for CriticBrowser banned rules).
This PackageManifest class could maybe be added in other smalltalk than Pharo to ensure the compatibility.

Pharo 6 support

  • Color >> #asHTMLColor is gone in Pharo 6 but the only senders are tests. Why do we test this method?
  • Smalltalk #removeFromShutDownList: is gone, #addToStartUpList: is still there though
  • GRStringTest >> #testSubStrings breaks but it tests ANSI behaviour
  • GRSlimeTest >> #testUsesCurlyBraceArrays breaks but that looks like and RB bug

Add support for Pharo 8

I tried to load MDL in Pharo 8 but it failed because Pharo 8 is not defined for grease. It will probably be the same for Seaside.

Base64 encoding for Pharo 7 (avoid Base64MimeConverter)

In Pharo 7 the class Base64MimeConverter should be avoided and it is better to use:

base64Decoded
base64Encoded

on String.

So GRPharoPlatform>>base64Decode: aString should be changed from

base64Decode: aString
	^ (Base64MimeConverter mimeDecodeToChars: aString readStream) contents

to

base64Decode: aString
	^ aString base64Decoded

Consider adding GRPlatform >> #thisContext

Apparently GRPlatform on VASt has a #thisContext method as replacement for a missing thisContext variable. Gemstone/S also has not thisContext variable and has to change all the continuation code.

A default implementation could look like this

thisContext
  ^ thisContext sender

Rename dev branch

The dev branch should be renamed to develop to match the Seaside repository.

#= not defined for GRSmallDictionary

(original issue disappeared because old Grease repo was removed)

@dalehenrich was wondering why comparison was not defined on GRSmallDictionary while he is working on porting STON to GemStone. Instead of porting SmallDictionary, he wants to use GRSmallDictionary. However, this requires a comparison to be defined on that class.

GRSmallDictionary2 removeKey: is not working

The following code

GRSmallDictionary2 new
	at: 'x' put: 'x';
	at: 'y' put: 'y';
	at: 'z' put: 'z';
	removeKey: 'z'

produces a subscript out of bounds. Tested in Pharo 7.

This is a simplified example, we hitted this problem in some Seaside code trying to remove some keys from the arguments of a JSObject.

Implement GRPlatform >> #thisContext on GemStone

We now have a #thisContext method for dialects that do not have a thisContext variable.

In order to get the tests running and the #stackDepth method working we need the following API:

  • #sender: Answer the context that sent the that created the receiver. Can either be a block or or method context. Is nil for the topmost stack frame.

In order to get WAPharoWalkback to work we need the following API:

  • #receiver: Answer the receiver object of the message receiver. Can be a block object.
  • #printStringLimitedTo:
  • #tempAt: Answer the temporary variable at the given index.

We used to send #tempScopedNames but that seems to be gone.
We used to send more messages but this seems to be the only part of the Pharo context API that is guaranteed to work.

There are references to thisContext in methods named evaluate that read something like

evaluate
	"GemStone does not have a thisContext variable..."

	^input evaluateInContext: self object symbolList: GsSession currentSession symbolList

I left out what we need for continuations since they're going to be different for GemStone anyway.

Since they are GemStone specific anyway I don't know how much replacing these makes sense.

Process class removed from GemStone 3.3

The class was never functional and now it was removed in GemStone 3.3:

Warning: This package depends on the following classes:
  Process
You must resolve these dependencies before you will be able to load these definitions: 
  Process>>properties

Loaded -> Grease-GemStone-Core-dkh.56 --- filetree:///opt/git/Grease/repository [6a76165:dev] --- cache

Can afford to just remove the method completely ...

Remove build for Pharo 3

We no longer support Pharo 3 with Seaside, can we also drop support for Pharo 3 in Grease? Then we could go metadataless.

Add GRNotificationBasedDynamicVariable

Add a GRNotificationBasedDynamicVariable that works like the legacy WADynamicVariable in order to ease ports that do not have dynamic variables or thread/process local variables.

Redo Pharo packages

The current Pharo packages are done so that code duplication is minimised but the result is very confusing. Eg. Grease-Pharo30-Core and Grease-Pharo40-Core are both loaded into a Pharo 5 image.

I wonder if it would be better to just copy and paste the packages for every dialect version.

Consider Spec integration

For better debugger integration in Pharo we could add the following methods

For GRSmallDictionary class

inspectorClass
	^ EyeDictionaryInspector

For GRSmallOrderedSet class

inspectorClass
	^ EyeCollectionInspector

Maybe they should go into a Grease-Pharo-Spec package so we don't get undeclareds in minimal images.

Convert GLASS1 to use SeasideSt/Grease and 3.6.0 port

Contrary to popular belief, the GLASS1 baseline uses GsDevKit/Grease, not SeasideSt/Grease, despite that, it seems that the actual code loaded into GemStone is identical in both repositories, so it is a technical difference at the moment.

3.6.0 will require some changes in Grease (it looks like), so it seems to be a good time to make the switch.

The major impact is that GsDevKit_home will start cloning SeasideSt/Grease for new installations (GsDevKit/GsDevKit_home#295) and I will be looking into trying to automate the update for old installations ..

MessageSend overrides in Squeak 5

From @marschall on October 4, 2015 15:6

Hi, today I noticed I had a dirty Kernel package in Squeak 5 due to
Grease overrides of three methods. Squeak has subsequently made
improvements to these methods which may be able to be adopted by
Pharo. They were changed in 2011 to not create a temporary Array.

MessageSend>>#value:
MessageSend>>#value:value:
MessageSend>>#valueWithPossibleArgs:

All the Grease, JQuery, Javascript and Seaside tests passed with the
modern versions. The Squeak 5 version of these methods is in the
attached changeset.

Best,
Chris

http://lists.squeakfoundation.org/pipermail/seaside-dev/2015-October/006682.html

Copied from original issue: SeasideSt/Seaside#858

Missing class in Pharo

In Pharo 5 and 6 (at least) there is no class MailSender but Grease-Pharo30-Core reference this class.

See GRPharoPlateform>>seasideSmtpServer.

As for GemStone 3.3 we do not need #changeTo: hack anymore (and it breaks)

On GemStone 3.3 and beyond, the hack of changeClassTo: to convert strings to UTF8 fails. Moreover, #_encodeAsUTF8intoString was added into the system so we should use that.

The new code should be:

GRUtf8CodecStream>>nextPutAll: 
  binary
    ifTrue: [ stream nextPutAll: aString asString ]
    ifFalse: [ stream nextPutAll: aString _encodeAsUTF8intoString ]

 Utf8>>asString
    ^ self decodeToUnicode

The whole discussion of this fix is in a thread "Again, Corrup Error preventing debugging real seaside exception" on the GLASS mailing list.

I am a bit out of time right now to setup everything to make a PR, but I will see if I have time later.

Consider Glamour integration

For a better debugging experience in Pharo we should consider Glamour integration for things like GRSmallDictionary and GRSmallOrderedCollection.

Dictionary has quite a few methods dedicated to this #gtInspectorItemsIn:, #gtInspectorKeysIn:, #spotterForKeysFor:, #gtDebuggerSUnitPrint.

Maybe they should go into a Grease-Pharo-Glamour package so we don't get undeclareds in minimal images.

Update baseline for Pharo 9

Loading Grease to Pharo 9 does not load Pharo-specific packages.

Probable reason is that Grease baseline has each Pharo version explicitely named in baseline and there is no entry for Pharo 9 yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.